This commit is contained in:
rex
2025-09-03 16:09:04 +08:00
parent 1e97034ebd
commit 9ad63297f1
2 changed files with 15 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
import { useGlobalStore } from '@/store/global';
import './index.css';
import { isEmpty } from 'lodash-es';
import { EVENT, mujian } from '@/utils/mujian';
import { EVENT, getMujian } from '@/utils/mujian';
function Home() {
const { count, increment } = useGlobalStore((state) => state);
@@ -10,6 +10,7 @@ function Home() {
console.log('isEmpty', isEmpty(count));
return (
<>
<div>
@@ -19,17 +20,21 @@ function Home() {
<button type="button" onClick={increment}>
Increment
</button>
<p>Count: {count}</p>
<br />
<button
type="button"
onClick={() => {
mujian.emit(EVENT.MUJIAN_AI_CHAT_SEND_MESSAGE, {
onClick={async() => {
(await getMujian()).emit(EVENT.MUJIAN_AI_CHAT_SEND_MESSAGE, {
message: 'Hello, World!',
});
}}
>
Hello
</button>
<p>Count: {count}</p>
</>
);
}