This commit is contained in:
jsy_zjg 2025-01-10 15:25:17 +08:00
parent 7497401f5e
commit d2720f8aa6
2 changed files with 24 additions and 19 deletions

View File

@ -26,14 +26,18 @@ export function getCodePhone(data) {
}
//手机号登录
export function phoneLogin(data) {
export function phoneLogin(mobilePhone,code, uuid) {
return request({
url: '/auth/loginPhone',
headers: {
isToken: false
},
method: 'post',
data: data
data: {
mobilePhone,
code,
uuid
}
})
}

View File

@ -83,7 +83,7 @@
rsaDecrypt
} from "@/utils/rsa"
import config from '@/config.js'
import { getCodePhone } from "@/api/login";
import { getCodePhone,phoneLogin } from "@/api/login";
const loginForm = ref({
loginName: "admin",
password: "admin123",
@ -258,28 +258,29 @@
password: loginObj.password
}
}
store
.dispatch(loginAPI.url, loginAPI.data)
.then(res => {
loginSuccess()
})
.catch(error => {
uni.showToast({
title: error,
icon: "error"
})
})
.finally(() => {})
} else {
loginObj.mobilePhone = loginObj.phone;
loginAPI = {
url: "phoneLogin",
data: loginObj
}
console.log(loginObj)
phoneLogin(loginObj.mobilePhone,loginObj.code,loginObj.uuid).then(res=>{
})
}
if (!loginAPI) {
return;
}
store
.dispatch(loginAPI.url, loginAPI.data)
.then(res => {
loginSuccess()
})
.catch(error => {
uni.showToast({
title: error,
icon: "error"
})
})
.finally(() => {})
}
//