add captcha

This commit is contained in:
lejianwen
2024-12-18 12:42:55 +08:00
parent 8ecfe9cbd0
commit f20003e619
9 changed files with 157 additions and 102 deletions
+4 -3
View File
@@ -41,14 +41,15 @@ export const useUserStore = defineStore({
},
async login (form) {
const res = await login(form).catch(_ => false)
if (res) {
const res = await login(form).catch(e => e)
console.log('login', res)
if (!res.code) {
useAppStore().loadConfig()
const userData = res.data
this.saveUserData(userData)
return userData
} else {
return false
return Promise.reject(res)
}
},
async info () {