fix: 2fa验证登陆成功后,修复主题颜色类名动态赋值为null
This commit is contained in:
@@ -113,7 +113,6 @@ import { mapActions } from 'vuex'
|
|||||||
import QRCode from 'qrcodejs2'
|
import QRCode from 'qrcodejs2'
|
||||||
import bus from '@/libs/bus.js'
|
import bus from '@/libs/bus.js'
|
||||||
import { get } from '@/http'
|
import { get } from '@/http'
|
||||||
import { loadI18n } from '@/components/common/i18n'
|
|
||||||
export default {
|
export default {
|
||||||
name: 'login',
|
name: 'login',
|
||||||
data () {
|
data () {
|
||||||
@@ -134,6 +133,7 @@ export default {
|
|||||||
loading: false,
|
loading: false,
|
||||||
lang: 'en', // en/cn
|
lang: 'en', // en/cn
|
||||||
verifyShow: false,
|
verifyShow: false,
|
||||||
|
theme: 1,
|
||||||
authBindShow: false,
|
authBindShow: false,
|
||||||
authToken: '',
|
authToken: '',
|
||||||
QRCode: '',
|
QRCode: '',
|
||||||
@@ -160,6 +160,7 @@ export default {
|
|||||||
this.authToken = res.data.authToken
|
this.authToken = res.data.authToken
|
||||||
this.lang = res.data.user.lang || localStorage.getItem('nz-language')
|
this.lang = res.data.user.lang || localStorage.getItem('nz-language')
|
||||||
this.$i18n.locale = this.lang
|
this.$i18n.locale = this.lang
|
||||||
|
this.theme = res.data.user.theme
|
||||||
// 获取可选语言
|
// 获取可选语言
|
||||||
get('/sys/dict/all?type=lang').then(response => {
|
get('/sys/dict/all?type=lang').then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
@@ -216,7 +217,8 @@ export default {
|
|||||||
localStorage.setItem('nz-prometheus-federation-enabled', res.data.prometheusFederationEnabled)
|
localStorage.setItem('nz-prometheus-federation-enabled', res.data.prometheusFederationEnabled)
|
||||||
localStorage.setItem('nz-language', this.lang)
|
localStorage.setItem('nz-language', this.lang)
|
||||||
res.data.user = {
|
res.data.user = {
|
||||||
lang: this.lang
|
lang: this.lang,
|
||||||
|
theme: this.theme
|
||||||
}
|
}
|
||||||
this.loginSuccess(res)
|
this.loginSuccess(res)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user