fix(entry): fix bug

This commit is contained in:
zhangheng
2026-02-28 16:20:58 +08:00
parent 4aa29b80d1
commit b3da1222d9
2 changed files with 15 additions and 15 deletions

View File

@@ -10,25 +10,25 @@ export default function EntryCheck() {
const { setUserPermissionInfo } = usePermissionStore() const { setUserPermissionInfo } = usePermissionStore()
const asyncGetUserPermission = useCallback(async () => { const asyncGetUserPermission = useCallback(async () => {
const { message: permissionRes } = await getUserPermission() try {
const { uid, name } = permissionRes const { message: permissionRes } = await getUserPermission()
setUserPermissionInfo({ const { uid, name } = permissionRes
user_id: uid, setUserPermissionInfo({
user_name: name, user_id: uid,
detailInfo: permissionRes, user_name: name,
}) detailInfo: permissionRes,
})
window.location.href = `${process.env.NEXT_PUBLIC_BASE_PATH}/management`
} catch {
window.location.href = "/login"
}
}, [setUserPermissionInfo]) }, [setUserPermissionInfo])
useEffect(() => { useEffect(() => {
if (!user_info.account) { if (!user_info.account) {
window.location.href = "/login" window.location.href = "/login"
} else { } else {
try { asyncGetUserPermission()
asyncGetUserPermission()
window.location.href = `${process.env.NEXT_PUBLIC_BASE_PATH}/management`
} catch {
window.location.href = "/login"
}
} }
}, [asyncGetUserPermission, user_info.account]) }, [asyncGetUserPermission, user_info.account])
return <></> return <></>

View File

@@ -47,5 +47,5 @@ export async function qr_login(
} }
} }
export const APP_ID = "cli_a9a902d6c3b95ceb" export const APP_ID = "cli_a56577acb2f3d00c"
export const APP_SECRECT = "zVbsYlJa3nzK5DwabshHFgcWQdnp4HLu" export const APP_SECRECT = "168xtvkFLnVbZd1Ih5T5agKue3JxJ87V"