From 0a091f6ba19127f4e5c19da55e306e738760cb77 Mon Sep 17 00:00:00 2001 From: aihe <961836564@qq.com> Date: Wed, 16 Apr 2025 23:54:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/api/url.js | 2 +- common/api/user.js | 4 ++-- components/buns-api/login/index.vue | 3 +++ components/buns-api/login/mp-login.vue | 8 ++++---- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/common/api/url.js b/common/api/url.js index b4535ea..1cb8c88 100644 --- a/common/api/url.js +++ b/common/api/url.js @@ -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`,// 获取省市区列表 diff --git a/common/api/user.js b/common/api/user.js index cf52703..2ed2f50 100644 --- a/common/api/user.js +++ b/common/api/user.js @@ -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 = {})=> { diff --git a/components/buns-api/login/index.vue b/components/buns-api/login/index.vue index 3faa6ec..c76bf8f 100644 --- a/components/buns-api/login/index.vue +++ b/components/buns-api/login/index.vue @@ -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(){ diff --git a/components/buns-api/login/mp-login.vue b/components/buns-api/login/mp-login.vue index 78a9384..0538743 100644 --- a/components/buns-api/login/mp-login.vue +++ b/components/buns-api/login/mp-login.vue @@ -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) // 更新用户信息