From 7a02804fc99b41a1b058d9ec381c6925f6178d68 Mon Sep 17 00:00:00 2001 From: 26947 <12@1> Date: Sat, 8 Jun 2024 18:05:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 6 ++++++ pages/login.vue | 7 +++++-- pages/mine/index.vue | 2 +- utils/request.js | 2 +- utils/upload.js | 2 +- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pages.json b/pages.json index 5242339..6f967bf 100644 --- a/pages.json +++ b/pages.json @@ -127,6 +127,12 @@ "navigationBarTitleText": "登录" } }, + { + "path": "pages/login", + "style": { + "navigationBarTitleText": "登录" + } + }, { "path": "pages/register", "style": { diff --git a/pages/login.vue b/pages/login.vue index 4196c41..1f041b4 100644 --- a/pages/login.vue +++ b/pages/login.vue @@ -34,7 +34,7 @@ 《隐私协议》 - + @@ -47,7 +47,7 @@ export default { codeUrl: "", captchaEnabled: true, // 用户注册开关 - register: false, + register: true, globalConfig: getApp().globalData.config, loginForm: { username: "admin", @@ -128,6 +128,7 @@ export default { this.$store.dispatch('Login', this.loginForm).then(() => { this.$modal.closeLoading() this.loginSuccess() + }).catch(() => { if (this.captchaEnabled) { this.getCode() @@ -137,7 +138,9 @@ export default { // 登录成功后,处理函数 loginSuccess(result) { // 设置用户信息 + this.$store.dispatch('GetUserInfo'); this.$store.dispatch('GetInfo').then(res => { + this.$store.dispatch('getQNDomainInfo') this.$tab.reLaunch('/pages/index') }) } diff --git a/pages/mine/index.vue b/pages/mine/index.vue index b876009..6e22a92 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -160,7 +160,7 @@ const info = () => { } info(); function handleToLogin() { - proxy.$tab.reLaunch('/pages/loginInfo/login') + proxy.$tab.reLaunch('/pages/login') } const handleToUserInfo = () => { proxy.$tab.navigateTo('/pages/mine/info/userInfo') diff --git a/utils/request.js b/utils/request.js index 0215042..5857329 100644 --- a/utils/request.js +++ b/utils/request.js @@ -37,7 +37,7 @@ const request = config => { showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => { if (res.confirm) { store.dispatch('LogOut').then(res => { - uni.reLaunch({ url: '/pages/loginInfo/login' }) + uni.reLaunch({ url: '/pages/login' }) }) } }) diff --git a/utils/upload.js b/utils/upload.js index 04c2423..2a9edf3 100644 --- a/utils/upload.js +++ b/utils/upload.js @@ -38,7 +38,7 @@ export default function upload(config) { showConfirm("登录状态已过期,您可以继续留在该页面,或者重新登录?").then(res => { if (res.confirm) { store.dispatch('LogOut').then(res => { - uni.reLaunch({ url: '/pages/loginInfo/login' }) + uni.reLaunch({ url: '/pages/login' }) }) } })