Merge branch 'material-ui' of http://192.168.0.75:3000/bonus/bonus-ui into material-ui

This commit is contained in:
hongchao 2025-04-17 14:07:13 +08:00
commit 529859ce3d
2 changed files with 18 additions and 9 deletions

View File

@ -7,6 +7,8 @@ import { tansParams, blobValidate } from '@/utils/bonus'
import cache from '@/plugins/cache' import cache from '@/plugins/cache'
import { saveAs } from 'file-saver' import { saveAs } from 'file-saver'
import { decryptWithSM4, encryptWithSM4, hashWithSM3AndSalt } from '@/utils/sm' import { decryptWithSM4, encryptWithSM4, hashWithSM3AndSalt } from '@/utils/sm'
import router from '@/router'
const systemConfig = JSON.parse(localStorage.getItem('systemConfig')) || { const systemConfig = JSON.parse(localStorage.getItem('systemConfig')) || {
requestConfig: { encryptRequest: false, checkIntegrity: false, encryptResponse: false } requestConfig: { encryptRequest: false, checkIntegrity: false, encryptResponse: false }
}; };
@ -110,9 +112,9 @@ service.interceptors.response.use(res => {
if (code === 401) { if (code === 401) {
console.log('🚀 ~ process.env.VUE_APP_BASE_API:', process.env.VUE_APP_BASE_API) console.log('🚀 ~ process.env.VUE_APP_BASE_API:', process.env.VUE_APP_BASE_API)
if (process.env.VUE_APP_BASE_API == '/iws/jiju-api') { if (process.env.VUE_APP_BASE_API == '/iws/jiju-api') {
this.$store.dispatch('LogOut').then(() => { store.dispatch('LogOut').then(() => {
}).catch((err) => { }).catch((err) => {
console.log('🚀 ~ this.$store.dispatch ~ err:', err) console.log('🚀 ~ store.dispatch ~ err:', err)
}) })
setTimeout(() => { setTimeout(() => {
// 'http://sgwpdm.ah.sgcc.com.cn/iws/cas/login?appId=3874dcb953f184dc75450e33d6d6d4fa&service=http://sgwpdm.ah.sgcc.com.cn/iws/mea-view/', // 'http://sgwpdm.ah.sgcc.com.cn/iws/cas/login?appId=3874dcb953f184dc75450e33d6d6d4fa&service=http://sgwpdm.ah.sgcc.com.cn/iws/mea-view/',
@ -121,11 +123,11 @@ service.interceptors.response.use(res => {
) )
}, 500) }, 500)
} else { } else {
this.$store.dispatch('LogOut').then(() => { store.dispatch('LogOut').then(() => {
// location.href = '/login' // location.href = '/login'
this.$router.push('/login') router.push('/login')
}).catch(() => { }).catch(() => {
this.$router.push('/login') router.push('/login')
}) })
} }
return Promise.reject('无效的会话,或者会话已过期,请重新登录。') return Promise.reject('无效的会话,或者会话已过期,请重新登录。')

View File

@ -201,7 +201,7 @@ export default {
verificationCode: [{ required: true, trigger: 'blur', message: '请输入验证码' }] verificationCode: [{ required: true, trigger: 'blur', message: '请输入验证码' }]
}, },
loading: false, loading: false,
captchaEnabled: true, captchaEnabled: false,
redirect: undefined, redirect: undefined,
isSendingCode: false, isSendingCode: false,
countdown: 0, countdown: 0,
@ -212,8 +212,16 @@ export default {
}, },
computed: { computed: {
config() { 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 ( return (
JSON.parse(localStorage.getItem('systemConfig')) || { systemConfig || {
loginConfig: { loginConfig: {
phonePassword: true, phonePassword: true,
emailPassword: true, emailPassword: true,
@ -225,7 +233,7 @@ export default {
emailRegisters: true emailRegisters: true
} }
} }
) // JSON )
}, },
loginRules() { loginRules() {
return this.loginMethod === 'password' ? this.passwordLoginRules : this.mobileLoginRules return this.loginMethod === 'password' ? this.passwordLoginRules : this.mobileLoginRules
@ -285,7 +293,6 @@ export default {
} }
} else { } else {
this.isIws = false this.isIws = false
this.getCode()
this.getCookie() this.getCookie()
} }
}, },