diff --git a/app/entry/page.tsx b/app/entry/page.tsx index 567ba3c..4a59867 100644 --- a/app/entry/page.tsx +++ b/app/entry/page.tsx @@ -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 <> diff --git a/components/login/feishu/util.ts b/components/login/feishu/util.ts index 4fe5b94..1411b24 100644 --- a/components/login/feishu/util.ts +++ b/components/login/feishu/util.ts @@ -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"