账号禁用或无权限自动退出
continuous-integration/drone/push Build is passing Details

uat_us
wangxiaoshuang 2025-01-10 17:38:54 +08:00
parent 66d09ca284
commit d636813210
2 changed files with 14 additions and 5 deletions

View File

@ -403,8 +403,12 @@ async function VueInit() {
}
_vm.$store.dispatch('user/logout').then(res => {
// window.location.href = `/login`
if (_vm.$msgbox) {
_vm.$msgbox.close();
try {
if (_vm.$msgbox && _vm.$msgbox.close) {
_vm.$msgbox.close();
}
} catch (err) {
console.log(err)
}
_vm.$FB.close();
_vm.$FBT.close();

View File

@ -1,11 +1,11 @@
import axios from 'axios'
import _vm from '@/main'
import { Message, MessageBox, Alert } from 'element-ui'
import store from '@/store'
import router from '@/router'
import WHITELIST from "./whiteList"
import moment from 'moment-timezone';
import { encryptConfig } from "@/utils/encrypt"
const ROUTER = require('@/router');
axios.defaults.withCredentials = false
const service = axios.create({
baseURL: '/api',
@ -91,8 +91,13 @@ service.interceptors.response.use(
const status = error.response.status
if (error.response.data && (error.response.data.Code === -1 || error.response.data.Code === -2)) {
store.dispatch('user/logout').then(() => {
if (_vm.$msgbox) {
_vm.$msgbox.close();
let _vm = ROUTER.default.app
try {
if (_vm.$msgbox && _vm.$msgbox.close) {
_vm.$msgbox.close();
}
} catch (err) {
console.log(err)
}
router.push(`/login`)
this.$i18n.locale = 'zh'