perf: 凭证校验
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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 (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user