From 42981e127ea8760b7d8cc0ed307044d0fa334514 Mon Sep 17 00:00:00 2001 From: bb_pan Date: Wed, 16 Apr 2025 17:44:49 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/login1.vue | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/views/login1.vue b/src/views/login1.vue index 46dca383..2ae8d78b 100644 --- a/src/views/login1.vue +++ b/src/views/login1.vue @@ -201,7 +201,7 @@ export default { verificationCode: [{ required: true, trigger: 'blur', message: '请输入验证码' }] }, loading: false, - captchaEnabled: true, + captchaEnabled: false, redirect: undefined, isSendingCode: false, countdown: 0, @@ -212,8 +212,16 @@ export default { }, computed: { config() { + console.log('🚀 ~ config ~ config:', localStorage.getItem('systemConfig')) + let systemConfig = null + try { + systemConfig = JSON.parse(localStorage.getItem('systemConfig')) + console.log('🚀 ~ config ~ systemConfig:', systemConfig) + } catch (err) { + console.log('获取config失败:', err) + } return ( - JSON.parse(localStorage.getItem('systemConfig')) || { + systemConfig || { loginConfig: { phonePassword: true, emailPassword: true, @@ -225,7 +233,7 @@ export default { emailRegisters: true } } - ) // 获取 JSON 对象 + ) }, loginRules() { return this.loginMethod === 'password' ? this.passwordLoginRules : this.mobileLoginRules @@ -285,7 +293,6 @@ export default { } } else { this.isIws = false - this.getCode() this.getCookie() } }, From 16bd837711773dfc3761656d304f4520633fcfa2 Mon Sep 17 00:00:00 2001 From: bb_pan Date: Thu, 17 Apr 2025 10:55:10 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index e4cb091f..91bc5cd6 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -7,6 +7,8 @@ import { tansParams, blobValidate } from '@/utils/bonus' import cache from '@/plugins/cache' import { saveAs } from 'file-saver' import { decryptWithSM4, encryptWithSM4, hashWithSM3AndSalt } from '@/utils/sm' +import router from '@/router' + const systemConfig = JSON.parse(localStorage.getItem('systemConfig')) || { requestConfig: { encryptRequest: false, checkIntegrity: false, encryptResponse: false } }; @@ -123,9 +125,9 @@ service.interceptors.response.use(res => { } else { this.$store.dispatch('LogOut').then(() => { // location.href = '/login' - this.$router.push('/login') + router.push('/login') }).catch(() => { - this.$router.push('/login') + router.push('/login') }) } return Promise.reject('无效的会话,或者会话已过期,请重新登录。') From 58f8fbaffa4082e708c217e08b7782e908cce1fe Mon Sep 17 00:00:00 2001 From: bb_pan Date: Thu, 17 Apr 2025 11:05:07 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index 91bc5cd6..18c24eee 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -112,9 +112,9 @@ service.interceptors.response.use(res => { if (code === 401) { console.log('🚀 ~ process.env.VUE_APP_BASE_API:', process.env.VUE_APP_BASE_API) if (process.env.VUE_APP_BASE_API == '/iws/jiju-api') { - this.$store.dispatch('LogOut').then(() => { + store.dispatch('LogOut').then(() => { }).catch((err) => { - console.log('🚀 ~ this.$store.dispatch ~ err:', err) + console.log('🚀 ~ store.dispatch ~ err:', err) }) setTimeout(() => { // 'http://sgwpdm.ah.sgcc.com.cn/iws/cas/login?appId=3874dcb953f184dc75450e33d6d6d4fa&service=http://sgwpdm.ah.sgcc.com.cn/iws/mea-view/', @@ -123,7 +123,7 @@ service.interceptors.response.use(res => { ) }, 500) } else { - this.$store.dispatch('LogOut').then(() => { + store.dispatch('LogOut').then(() => { // location.href = '/login' router.push('/login') }).catch(() => {