NEZ-926 fix: 修改 开启2FA 无法登录的问题

This commit is contained in:
zhangyu
2021-08-23 14:11:58 +08:00
parent edb81b5a98
commit 366e891081
3 changed files with 11 additions and 11 deletions

View File

@@ -167,15 +167,6 @@ export default {
// 登录成功记录用户名、token和lang
this.authToken = res.data.authToken
sessionStorage.setItem('nz-token', res.data.authToken)
this.$get('/sys/user/profile').then(response => {
if (response.code === 200) {
const userList = response.user
console.log(userList)
// 保存当前用户的 userId
localStorage.setItem('nz-user-id', userList.id)
localStorage.setItem('nz-user-name', userList.name)
}
})
if (res.data.authFlag === 1) {
if (res.data.authBind === 0) {
this.verifyShow = true

View File

@@ -38,7 +38,7 @@
</div>
</div>
<div class="profile-left__center">
<span style="margin:0 10px 10px 0"><i class="nz-icon nz-icon-zhongzhi2FA" style="color: orange"></i></span>
<span style="margin:0 10px 10px 0"><i class="nz-icon nz-icon-yanzhengma" style="color: orange"></i></span>
<div class="profile-left__center-title">
<div>{{$t('profile.twoFactorAuthentication')}}</div>
</div>

View File

@@ -1,4 +1,4 @@
import { post } from '../http'
import { post, get } from '../http'
import router from '../router'
import bus from '../libs/bus'
import { sortByOrderNum } from '../permission'
@@ -65,6 +65,15 @@ const user = {
}
})
})
get('/sys/user/profile').then(response => {
if (response.code === 200) {
const userList = response.user
console.log(userList)
// 保存当前用户的 userId
localStorage.setItem('nz-user-id', userList.id)
localStorage.setItem('nz-user-name', userList.name)
}
})
},
logoutSuccess (store, res) {
sessionStorage.removeItem('nz-username')