Commit f79595ab by caoyanzhi

update: 登录账号变更提示

parent 43b49298
...@@ -31,23 +31,19 @@ export default { ...@@ -31,23 +31,19 @@ export default {
if (res.data.errorCode === 0) { if (res.data.errorCode === 0) {
const useId = res.data.result && res.data.result.userId; const useId = res.data.result && res.data.result.userId;
if (localStorage.getItem('useId') !== useId) { if (localStorage.getItem('useId') !== useId) {
localStorage.setItem('useId', useId);
// 串号 // 串号
this.$confirm('当前登录账号已经发生变化,如果您在其他页面已经登录另一个账号,请退出重新登录!', '提示', { this.$confirm('当前登录账号已经发生变化,如果您在其他页面已经登录另一个账号,请重新登录!', '登录账号变更提示', {
type: 'error', confirmButtonText: '重新登录',
confirmButtonText: '退出重新登录', cancelButtonText: '刷新页面',
cancelButtonText: '刷新页面' type: 'error'
}) })
.then(() => { .then(() => {
localStorage.setItem('useId', useId); window.location.href = '/gic-web/#/login';
// window.location.reload();
this.doLogout();
}) })
.catch(() => { .catch(() => {
// window.location.reload(); window.location.href = '/report';
this.doLogout();
}); });
} else {
localStorage.setItem('useId', useId);
} }
} else { } else {
this.$message.error(res.data.message); this.$message.error(res.data.message);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment