fix(entry): fix bug
This commit is contained in:
@@ -10,25 +10,25 @@ export default function EntryCheck() {
|
||||
const { setUserPermissionInfo } = usePermissionStore()
|
||||
|
||||
const asyncGetUserPermission = useCallback(async () => {
|
||||
const { message: permissionRes } = await getUserPermission()
|
||||
const { uid, name } = permissionRes
|
||||
setUserPermissionInfo({
|
||||
user_id: uid,
|
||||
user_name: name,
|
||||
detailInfo: permissionRes,
|
||||
})
|
||||
try {
|
||||
const { message: permissionRes } = await getUserPermission()
|
||||
const { uid, name } = permissionRes
|
||||
setUserPermissionInfo({
|
||||
user_id: uid,
|
||||
user_name: name,
|
||||
detailInfo: permissionRes,
|
||||
})
|
||||
window.location.href = `${process.env.NEXT_PUBLIC_BASE_PATH}/management`
|
||||
} catch {
|
||||
window.location.href = "/login"
|
||||
}
|
||||
}, [setUserPermissionInfo])
|
||||
|
||||
useEffect(() => {
|
||||
if (!user_info.account) {
|
||||
window.location.href = "/login"
|
||||
} else {
|
||||
try {
|
||||
asyncGetUserPermission()
|
||||
window.location.href = `${process.env.NEXT_PUBLIC_BASE_PATH}/management`
|
||||
} catch {
|
||||
window.location.href = "/login"
|
||||
}
|
||||
asyncGetUserPermission()
|
||||
}
|
||||
}, [asyncGetUserPermission, user_info.account])
|
||||
return <></>
|
||||
|
||||
@@ -47,5 +47,5 @@ export async function qr_login(
|
||||
}
|
||||
}
|
||||
|
||||
export const APP_ID = "cli_a9a902d6c3b95ceb"
|
||||
export const APP_SECRECT = "zVbsYlJa3nzK5DwabshHFgcWQdnp4HLu"
|
||||
export const APP_ID = "cli_a56577acb2f3d00c"
|
||||
export const APP_SECRECT = "168xtvkFLnVbZd1Ih5T5agKue3JxJ87V"
|
||||
|
||||
Reference in New Issue
Block a user