|
@@ -69,39 +69,45 @@ serviceAxios.interceptors.response.use(res => {
|
|
|
const code = res.data.code || 200;
|
|
|
// 获取错误信息
|
|
|
if(code == 5002){
|
|
|
- removeToken();
|
|
|
- MessageBox.confirm('登录状态已过期,请重新登录', '系统提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- showCancelButton:false,
|
|
|
- closeOnClickModal:false,
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }
|
|
|
- ).then(() => {
|
|
|
+ if(getToken()){
|
|
|
removeToken();
|
|
|
- if(localStorage.getItem('entranceJumpType') == 'PC'){
|
|
|
- window.location.href = process.env.VUE_APP_OUT_URL_PC;
|
|
|
- }else{
|
|
|
- window.location.href = process.env.VUE_APP_OUT_URL;
|
|
|
- }
|
|
|
- }).catch(() => {});
|
|
|
+ MessageBox.confirm('登录状态已过期,请重新登录', '系统提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ showCancelButton:false,
|
|
|
+ closeOnClickModal:false,
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }
|
|
|
+ ).then(() => {
|
|
|
+ if(localStorage.getItem('entranceJumpType') == 'PC'){
|
|
|
+ window.location.href = process.env.VUE_APP_OUT_URL;
|
|
|
+ }else{
|
|
|
+ router.replace({
|
|
|
+ path: '/'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(() => {});
|
|
|
+ }
|
|
|
}else if (code == 5005) {
|
|
|
- removeToken();
|
|
|
- MessageBox.confirm('没有相关权限,请重新登录', '系统提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- showCancelButton:false,
|
|
|
- closeOnClickModal:false,
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }
|
|
|
- ).then(() => {
|
|
|
+ if(getToken()){
|
|
|
removeToken();
|
|
|
- if(localStorage.getItem('entranceJumpType') == 'PC'){
|
|
|
- window.location.href = process.env.VUE_APP_OUT_URL_PC;
|
|
|
- }else{
|
|
|
- window.location.href = process.env.VUE_APP_OUT_URL;
|
|
|
- }
|
|
|
- }).catch(() => {});
|
|
|
+ MessageBox.confirm('没有相关权限,请重新登录', '系统提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ showCancelButton:false,
|
|
|
+ closeOnClickModal:false,
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }
|
|
|
+ ).then(() => {
|
|
|
+ if(localStorage.getItem('entranceJumpType') == 'PC'){
|
|
|
+ window.location.href = process.env.VUE_APP_OUT_URL;
|
|
|
+ }else{
|
|
|
+ router.replace({
|
|
|
+ path: '/'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(() => {});
|
|
|
+ }
|
|
|
}else if(code == 5007){
|
|
|
return res.data
|
|
|
}else if (code != 200) {
|
|
@@ -136,22 +142,25 @@ serviceAxios.interceptors.response.use(res => {
|
|
|
}
|
|
|
else if (message.includes("Request failed with status code")) {
|
|
|
if(message.substr(message.length - 3) == 401){
|
|
|
- removeToken();
|
|
|
- MessageBox.confirm('登录状态已过期,请重新登录', '系统提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- showCancelButton:false,
|
|
|
- closeOnClickModal:false,
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }
|
|
|
- ).then(() => {
|
|
|
+ if(getToken()){
|
|
|
removeToken();
|
|
|
- if(localStorage.getItem('entranceJumpType') == 'PC'){
|
|
|
- window.location.href = process.env.VUE_APP_OUT_URL_PC;
|
|
|
- }else{
|
|
|
- window.location.href = process.env.VUE_APP_OUT_URL;
|
|
|
- }
|
|
|
- }).catch(() => {});
|
|
|
+ MessageBox.confirm('登录状态已过期,请重新登录', '系统提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ showCancelButton:false,
|
|
|
+ closeOnClickModal:false,
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }
|
|
|
+ ).then(() => {
|
|
|
+ if(localStorage.getItem('entranceJumpType') == 'PC'){
|
|
|
+ window.location.href = process.env.VUE_APP_OUT_URL;
|
|
|
+ }else{
|
|
|
+ router.replace({
|
|
|
+ path: '/'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(() => {});
|
|
|
+ }
|
|
|
}else{
|
|
|
messageData = Message({
|
|
|
message: message,
|