From 315d2dd7eec59f0afe6b0cd7f6659eef26a27307 Mon Sep 17 00:00:00 2001 From: "453530270@qq.com" Date: Mon, 13 Nov 2023 14:36:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=99=BB=E5=BD=95=E6=93=8D?= =?UTF-8?q?=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/login/components/main.vue | 37 ++++++++++++++++++++++++--------- store/modules/user.js | 7 ++++--- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/pages/login/components/main.vue b/pages/login/components/main.vue index 821f8b8..02a5f5a 100644 --- a/pages/login/components/main.vue +++ b/pages/login/components/main.vue @@ -35,16 +35,17 @@ - 找回密码 - 立即注册 + 找回密码 + 立即注册 -
- -
+ + + + 我已阅读并同意网站的 《隐私政策 》和 + 《用户注册协议》 + + @@ -181,7 +182,8 @@ }) .then(result => { // 显示登录成功 - app.$toast(result.message) + app.$toast("登录成功") + //app.$toast(result.message) // 相应全局事件订阅: 刷新上级页面数据 uni.$emit('syncRefresh', true) // 跳转回原页面 @@ -209,7 +211,14 @@ } else { this.$navTo('pages/index/index') } - } + }, + + /** + * 阅读注册协议和隐私 + */ + gotopage(str){ + this.$toast(str) + } } } @@ -318,5 +327,13 @@ .privacy{ display: flex; margin-top: 10rpx; + + .ckbox{ + border-radius: 50%; + } + + .atxt{ + color: #4399ff; + } } diff --git a/store/modules/user.js b/store/modules/user.js index 0c2f7ca..205089f 100644 --- a/store/modules/user.js +++ b/store/modules/user.js @@ -3,15 +3,15 @@ import storage from '@/utils/storage' import * as LoginApi from '@/api/login' // 登陆成功后执行 -const loginSuccess = (commit, { token, userId }) => { +const loginSuccess = (commit, { token, accountId }) => { // 过期时间30天 const expiryTime = 30 * 86400 // 保存tokne和userId到缓存 - storage.set(USER_ID, userId, expiryTime) + storage.set(USER_ID, accountId, expiryTime) storage.set(ACCESS_TOKEN, token, expiryTime) // 记录到store全局变量 commit('SET_TOKEN', token) - commit('SET_USER_ID', userId) + commit('SET_USER_ID', accountId) } const user = { @@ -40,6 +40,7 @@ const user = { .then(response => { console.log("login ret:",response) const result = response.data + console.log("user rest:",result) loginSuccess(commit, result) resolve(response) })