fix(frontend): harden auth routing and callback error handling

This commit is contained in:
Chris
2026-03-30 02:46:35 +08:00
parent 278c2b6c67
commit 7b3f5bd5b8
4 changed files with 30 additions and 11 deletions

View File

@@ -32,7 +32,17 @@ const error = ref('')
onMounted(async () => {
try {
const code = route.query.code
const state = route.query.state
const oauthError = route.query.error
const oauthErrorDesc = route.query.error_description
if (oauthError) {
const reason = typeof oauthErrorDesc === 'string' && oauthErrorDesc
? oauthErrorDesc
: String(oauthError)
error.value = `登入失敗:${reason}`
setTimeout(() => router.push('/login'), 3000)
return
}
if (!code) {
error.value = '缺少驗證代碼,登入失敗'

View File

@@ -149,7 +149,6 @@ import {
getPermissionGroups,
createPermissionGroup,
addMemberToGroup,
removeMemberFromGroup,
groupGrant,
groupRevoke
} from '@/api/permission-groups'