perf: 凭证校验

This commit is contained in:
archer
2023-04-23 08:12:23 +08:00
parent e8d4933dc4
commit 9682c82713
4 changed files with 13 additions and 12 deletions

View File

@@ -38,9 +38,7 @@ const modelList = () => {
async (modelId: string) => {
setIsLoading(true);
try {
const chatId = await getChatSiteId(modelId);
router.push(`/chat?chatId=${chatId}`, undefined, {
router.push(`/chat?modelId=${modelId}`, undefined, {
shallow: true
});
} catch (err: any) {

View File

@@ -18,7 +18,7 @@ const PayModal = dynamic(() => import('./components/PayModal'));
const NumberSetting = () => {
const router = useRouter();
const { userInfo, updateUserInfo, initUserInfo } = useUserStore();
const { userInfo, updateUserInfo, initUserInfo, setUserInfo } = useUserStore();
const { setLoading } = useGlobalStore();
const { register, handleSubmit } = useForm<UserUpdateParams>({
defaultValues: userInfo as UserType
@@ -47,8 +47,9 @@ const NumberSetting = () => {
const onclickLogOut = useCallback(() => {
clearToken();
setUserInfo(null);
router.replace('/login');
}, [router]);
}, [router, setUserInfo]);
return (
<>