优化登录

This commit is contained in:
aihe 2025-04-16 23:54:10 +08:00
parent 3c0d404de1
commit 0a091f6ba1
4 changed files with 10 additions and 7 deletions

View File

@ -6,7 +6,7 @@ export default {
uploadFile: '/common/ossUpload', // 上传
loginByApp: `/loginByApp`, // 登录
loginByMP: `/loginByWeixin`, // 小程序登录
bindPhone: `/bindPhoneByWx`, // 绑定手机号
getPhoneByWx: `/getPhoneByWx`, // 解析手机号
getInfoByApp: `/getInfoByWxApp`,// 获取用户基本信息
getEmisCountry: `/oms2c/emisCountry/listSimple`, // 获取国家列表
getEmisRegion: `/oms2c/emisRegion/listSimple`,// 获取省市区列表

View File

@ -9,8 +9,8 @@ export const loginByMP = (data = {})=> {
return coreRequest(url.loginByMP, data)
}
export const bindPhone = (data = {}, option = {})=> {
return coreRequest(url.bindPhone, data, option)
export const getPhoneByWx = (data = {}, option = {})=> {
return coreRequest(url.getPhoneByWx, data, option)
}
export const getInfoByApp = (data = {}, option = {})=> {

View File

@ -72,6 +72,9 @@
console.error("auto login checkParams err=====", err)
}
this.lgDialog.show = !bl
if(this.lgDialog.show) { // 更新用户信息到组件中
this.$refs.lcRef?.updateSubmitLoginInfo?.(data)
}
return bl
},
async triggerLogin(){

View File

@ -83,6 +83,9 @@
...getCommonReqData().header,
}
},
updateSubmitLoginInfo(data = {}){
Object.assign(this.submitLogin, data)
},
async initData(){
// 防止多次触发
if(this.pageLoading) {
@ -122,12 +125,9 @@
return token
},
async getPhoneNumber(e){
let bPhoneRes = await apiService.bindPhone({ ...(e?.detail || {}), _loading: true }, this.commodHeaders())
let bPhoneRes = await apiService.getPhoneByWx({ ...(e?.detail || {}), _loading: true }, this.commodHeaders())
this.submitLogin.phoneNumber = bPhoneRes.phone
},
handleNicknamereview(e){
console.log(e)
},
async handleUpdateUserinfo() {
await checkParams(this.submitLogin, this.submitValidConfig)
// 更新用户信息