feat: make web-admin login QR-primary with password fallback

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-09-18 14:03:48 +08:00
1 parent f7c5a7477e
commit 6a5d93165b
2 files changed
+298 -22

No files matched your search

+39
View File
@@ -29,6 +29,45 @@ export async function fetchLogin(params: { username: string; password: string })
})
}
export function fetchWxQrCreate() {
return request.post<{
sessionId: string
expiresIn: number
qrImageBase64: string
}>({
url: '/web/auth/wx-qr/create',
data: {},
headers: { 'X-Api-Crypto': 'off' },
showErrorMessage: true
})
}
export function fetchWxQrStatus(sessionId: string) {
return request.get<{
status: string
message?: string
token?: string
refreshToken?: string
expiresIn?: number
userInfo?: {
id: string
username: string
realName: string
phone: string
role: string
roleNames?: string[]
regionId: string
regionName: string
avatarUrl?: string | null
}
}>({
url: '/web/auth/wx-qr/status',
params: { sessionId },
headers: { 'X-Api-Crypto': 'off' },
showErrorMessage: false
})
}
/**
* 获取当前用户信息
* @returns 用户信息