登录验证码接入

This commit is contained in:
biss committed 2026-09-11 22:05:07 +08:00
1 parent ae075bda6d
commit f489a3553c
15 files changed
+471 -19

No files matched your search

+8 -1
View File
@@ -28,10 +28,17 @@ export const useAuthStore = defineStore('auth', () => {
const isLoggedIn = computed(() => Boolean(token.value))
const isSuperAdmin = computed(() => user.value?.roles.includes('SuperAdmin') ?? false)
async function login(userName: string, password: string): Promise<{ twoFactorTicket?: string }> {
async function login(
userName: string,
password: string,
captchaTicket: string,
deviceId: string,
): Promise<{ twoFactorTicket?: string }> {
const { data } = await http.post('/auth/login', {
userName,
password,
captchaTicket,
deviceId,
isNativeApp: isNativeApp(),
})
if (data.requiresTotp) return { twoFactorTicket: String(data.twoFactorTicket) }