Spaces:
Running
Running
muxi feng
commited on
Commit
·
9f614f8
1
Parent(s):
f4ed138
修复编译报错
Browse files- app/components/login.tsx +2 -3
- app/components/markdown.tsx +1 -1
- app/components/user.tsx +1 -1
app/components/login.tsx
CHANGED
@@ -4,7 +4,7 @@ import ChatIcon from "../icons/chatgpt.svg";
|
|
4 |
import styles from "./login.module.scss";
|
5 |
import { IconButton } from "./button";
|
6 |
import { useUserStore } from "../store";
|
7 |
-
import { useEffect, useState } from "react";
|
8 |
import Image from "next/image";
|
9 |
import { encrypt } from "../rsaEncrypt";
|
10 |
|
@@ -34,14 +34,13 @@ export function Login() {
|
|
34 |
}, 4000);
|
35 |
getCode();
|
36 |
};
|
37 |
-
|
38 |
async function getCode() {
|
39 |
let img = await userStore.getCode();
|
40 |
setImg(img);
|
41 |
}
|
42 |
|
43 |
useEffect(() => {
|
44 |
-
getCode()
|
45 |
}, []);
|
46 |
|
47 |
return (
|
|
|
4 |
import styles from "./login.module.scss";
|
5 |
import { IconButton } from "./button";
|
6 |
import { useUserStore } from "../store";
|
7 |
+
import { Component, useCallback, useEffect, useState } from "react";
|
8 |
import Image from "next/image";
|
9 |
import { encrypt } from "../rsaEncrypt";
|
10 |
|
|
|
34 |
}, 4000);
|
35 |
getCode();
|
36 |
};
|
|
|
37 |
async function getCode() {
|
38 |
let img = await userStore.getCode();
|
39 |
setImg(img);
|
40 |
}
|
41 |
|
42 |
useEffect(() => {
|
43 |
+
getCode()
|
44 |
}, []);
|
45 |
|
46 |
return (
|
app/components/markdown.tsx
CHANGED
@@ -26,7 +26,7 @@ export function Mermaid(props: { code: string; onError: () => void }) {
|
|
26 |
console.error("[Mermaid] ", e.message);
|
27 |
});
|
28 |
}
|
29 |
-
}, [props
|
30 |
|
31 |
function viewSvgInNewWindow() {
|
32 |
const svg = ref.current?.querySelector("svg");
|
|
|
26 |
console.error("[Mermaid] ", e.message);
|
27 |
});
|
28 |
}
|
29 |
+
}, [props]);
|
30 |
|
31 |
function viewSvgInNewWindow() {
|
32 |
const svg = ref.current?.querySelector("svg");
|
app/components/user.tsx
CHANGED
@@ -136,7 +136,7 @@ export function User() {
|
|
136 |
useStor.getUserInfo()
|
137 |
}
|
138 |
setUserName(useStor.name)
|
139 |
-
},[useStor
|
140 |
|
141 |
useEffect(() => {
|
142 |
const keydownEvent = (e: KeyboardEvent) => {
|
|
|
136 |
useStor.getUserInfo()
|
137 |
}
|
138 |
setUserName(useStor.name)
|
139 |
+
},[useStor,accessStore])
|
140 |
|
141 |
useEffect(() => {
|
142 |
const keydownEvent = (e: KeyboardEvent) => {
|