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,6 +10,7 @@ export default function EntryCheck() {
const { setUserPermissionInfo } = usePermissionStore() const { setUserPermissionInfo } = usePermissionStore()
const asyncGetUserPermission = useCallback(async () => { const asyncGetUserPermission = useCallback(async () => {
try {
const { message: permissionRes } = await getUserPermission() const { message: permissionRes } = await getUserPermission()
const { uid, name } = permissionRes const { uid, name } = permissionRes
setUserPermissionInfo({ setUserPermissionInfo({
@@ -17,18 +18,17 @@ export default function EntryCheck() {
user_name: name, user_name: name,
detailInfo: permissionRes, 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"