From ecb94ba348f0d2f8a680df44a67f132be77712ec Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Tue, 7 Jan 2025 10:54:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 5 + pages/login/bind.vue | 253 +++++++++++++------------- pages/login/login.vue | 47 ++--- pages/login/register.vue | 12 +- pages/me/{xieyi.vue => agreement.vue} | 0 pages/me/privacy.vue | 2 +- 6 files changed, 156 insertions(+), 163 deletions(-) rename pages/me/{xieyi.vue => agreement.vue} (100%) diff --git a/pages.json b/pages.json index e77910d..bf4917e 100644 --- a/pages.json +++ b/pages.json @@ -76,6 +76,11 @@ "style": { "navigationBarTitleText": "隐私协议" } + }, { + "path": "pages/me/agreement", + "style": { + "navigationBarTitleText": "服务协议" + } }, { "path": "pages/index/search/index", diff --git a/pages/login/bind.vue b/pages/login/bind.vue index a18dc15..7d8245a 100644 --- a/pages/login/bind.vue +++ b/pages/login/bind.vue @@ -19,137 +19,134 @@ diff --git a/pages/login/login.vue b/pages/login/login.vue index 4818595..aec81b7 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -128,34 +128,27 @@ password: password, phone: mobile }) - - if (res.code === 0) { - uni.setStorageSync('token', res.token) - uni.setStorageSync('userId', res.user.userId) - uni.setStorageSync('userName', res.user.userName) - uni.setStorageSync('avatar', res.user.avatar ? res.user.avatar : '../../static/default/avatar.png') - uni.setStorageSync('phone', res.user.phone) - uni.setStorageSync('invitationCode', res.user.invitationCode) - uni.setStorageSync('sex', res.user.sex) - uni.setStorageSync('userId', res.user.userId) - //设置渠道码 - if (res.user.qdCode) { - uni.setStorageSync('qdCode', res.user.qdCode) - } - uni.showToast({ - title: '登录成功', - icon: 'none' - }) - uni.reLaunch({ - url:'/pages/index/index' - }) - } else{ - uni.hideLoading(); - uni.showToast({ - title: res.msg, - icon: 'none' - }) + uni.setStorageSync('token', res.token) + uni.setStorageSync('userId', res.user.userId) + uni.setStorageSync('userName', res.user.userName) + uni.setStorageSync('avatar', res.user.avatar ? res.user.avatar : '../../static/default/avatar.png') + uni.setStorageSync('phone', res.user.phone) + uni.setStorageSync('invitationCode', res.user.invitationCode) + uni.setStorageSync('sex', res.user.sex) + uni.setStorageSync('userId', res.user.userId) + //设置渠道码 + if (res.user.qdCode) { + uni.setStorageSync('qdCode', res.user.qdCode) } + uni.hideLoading(); + uni.showToast({ + title: '登录成功', + icon: 'none' + }) + uni.reLaunch({ + url:'/pages/index/index' + }) + } } diff --git a/pages/login/register.vue b/pages/login/register.vue index 39afe00..0391bb3 100644 --- a/pages/login/register.vue +++ b/pages/login/register.vue @@ -70,9 +70,7 @@ if (options.invitation ) { data.invitation = options.invitation } let res = await commonType(3) - if (res.code == 0) { - data.registerCode = res.data.value - } + data.registerCode = res.value }) /** @@ -96,8 +94,9 @@ title: '正在发送验证码...' }) let res = await setSendMsg(data.mobile,'login') - console.log(res) - if ( res.code == 0 ) { + uni.hideLoading(); + uni.hideToast(); + if( res ){ data.sending = true; uni.showToast({ title: '验证码发送成功请注意查收', @@ -109,11 +108,10 @@ uni.showModal({ showCancel: false, title: '短信发送失败', - content: res.msg ? res.msg : '请一分钟后再获取验证码' + content: '请一分钟后再获取验证码' }); } - uni.hideLoading(); } } diff --git a/pages/me/xieyi.vue b/pages/me/agreement.vue similarity index 100% rename from pages/me/xieyi.vue rename to pages/me/agreement.vue diff --git a/pages/me/privacy.vue b/pages/me/privacy.vue index f17a7f1..677edeb 100644 --- a/pages/me/privacy.vue +++ b/pages/me/privacy.vue @@ -27,7 +27,7 @@ async function getGuize() { let res = await commonType(155) - this.content = res.data.value + this.content = res.value } function cancel(){