登录验证码接入
This commit is contained in:
1 parent
ae075bda6d
commit
f489a3553c
15 files changed
+471
-19
No files matched your search
@@ -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) }
|
||||
|
||||
Reference in new issue
Block a user