mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 03:46:44 +08:00
Merge branch '20251121-fix-1298' of https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal into 20251121-fix-1298
This commit is contained in:
@@ -53,15 +53,30 @@ jsonRequest.interceptors.response.use(res => {
|
|||||||
} else {
|
} else {
|
||||||
if (code == 6001) { //针对于老系统的处理
|
if (code == 6001) { //针对于老系统的处理
|
||||||
store.dispatch('LogOut').then(() => {
|
store.dispatch('LogOut').then(() => {
|
||||||
location.href = ReLoginUrl;
|
if (top !== window) { // 判断当前是否在iframe内
|
||||||
|
top.location.href = ReLoginUrl;
|
||||||
|
} else {
|
||||||
|
window.location.href = ReLoginUrl;
|
||||||
|
}
|
||||||
|
// location.href = ReLoginUrl;
|
||||||
})
|
})
|
||||||
} else if (code === 401) {
|
} else if (code === 401) {
|
||||||
store.dispatch('LogOut').then(() => {
|
store.dispatch('LogOut').then(() => {
|
||||||
location.href = ReLoginUrl;
|
if (top !== window) { // 判断当前是否在iframe内
|
||||||
|
top.location.href = ReLoginUrl;
|
||||||
|
} else {
|
||||||
|
window.location.href = ReLoginUrl;
|
||||||
|
}
|
||||||
|
// location.href = ReLoginUrl;
|
||||||
})
|
})
|
||||||
} else if (code === 402) {
|
} else if (code === 402) {
|
||||||
store.dispatch('LogOut').then(() => {
|
store.dispatch('LogOut').then(() => {
|
||||||
location.href = ReLoginUrl;
|
if (top !== window) { // 判断当前是否在iframe内
|
||||||
|
top.location.href = ReLoginUrl;
|
||||||
|
} else {
|
||||||
|
window.location.href = ReLoginUrl;
|
||||||
|
}
|
||||||
|
// location.href = ReLoginUrl;
|
||||||
})
|
})
|
||||||
} else if (code === 403) {
|
} else if (code === 403) {
|
||||||
var msg = '当前操作没有权限';
|
var msg = '当前操作没有权限';
|
||||||
@@ -69,7 +84,12 @@ jsonRequest.interceptors.response.use(res => {
|
|||||||
return Promise.reject(new Error(msg))
|
return Promise.reject(new Error(msg))
|
||||||
//return res.data;
|
//return res.data;
|
||||||
} else if (code === 302) {
|
} else if (code === 302) {
|
||||||
location.href = ReLoginUrl;
|
if (top !== window) { // 判断当前是否在iframe内
|
||||||
|
top.location.href = ReLoginUrl;
|
||||||
|
} else {
|
||||||
|
window.location.href = ReLoginUrl;
|
||||||
|
}
|
||||||
|
// location.href = ReLoginUrl;
|
||||||
} else {
|
} else {
|
||||||
//Message({message: res.data.message, type: 'error'});
|
//Message({message: res.data.message, type: 'error'});
|
||||||
//console.log('err:' + res.data.error);
|
//console.log('err:' + res.data.error);
|
||||||
@@ -127,22 +147,42 @@ formRequest.interceptors.response.use(res => {
|
|||||||
} else {
|
} else {
|
||||||
if (code == 6001) { //针对于老系统的处理,因为老系统是字符串,所以这里不使用三等于号
|
if (code == 6001) { //针对于老系统的处理,因为老系统是字符串,所以这里不使用三等于号
|
||||||
store.dispatch('LogOut').then(() => {
|
store.dispatch('LogOut').then(() => {
|
||||||
location.href = ReLoginUrl;
|
if (top !== window) { // 判断当前是否在iframe内
|
||||||
|
top.location.href = ReLoginUrl;
|
||||||
|
} else {
|
||||||
|
window.location.href = ReLoginUrl;
|
||||||
|
}
|
||||||
|
// location.href = ReLoginUrl;
|
||||||
})
|
})
|
||||||
} else if (code === 401) {
|
} else if (code === 401) {
|
||||||
store.dispatch('LogOut').then(() => {
|
store.dispatch('LogOut').then(() => {
|
||||||
location.href = ReLoginUrl;
|
if (top !== window) { // 判断当前是否在iframe内
|
||||||
|
top.location.href = ReLoginUrl;
|
||||||
|
} else {
|
||||||
|
window.location.href = ReLoginUrl;
|
||||||
|
}
|
||||||
|
// location.href = ReLoginUrl;
|
||||||
})
|
})
|
||||||
} else if (code === 402) {
|
} else if (code === 402) {
|
||||||
store.dispatch('LogOut').then(() => {
|
store.dispatch('LogOut').then(() => {
|
||||||
location.href = ReLoginUrl;
|
if (top !== window) { // 判断当前是否在iframe内
|
||||||
|
top.location.href = ReLoginUrl;
|
||||||
|
} else {
|
||||||
|
window.location.href = ReLoginUrl;
|
||||||
|
}
|
||||||
|
// location.href = ReLoginUrl;
|
||||||
})
|
})
|
||||||
} else if (code === 403) {
|
} else if (code === 403) {
|
||||||
var msg = '当前操作没有权限';
|
var msg = '当前操作没有权限';
|
||||||
Message({ message: msg, type: 'error' });
|
Message({ message: msg, type: 'error' });
|
||||||
return Promise.reject(new Error(msg))
|
return Promise.reject(new Error(msg))
|
||||||
} else if (code === 302) {
|
} else if (code === 302) {
|
||||||
location.href = ReLoginUrl;
|
if (top !== window) { // 判断当前是否在iframe内
|
||||||
|
top.location.href = ReLoginUrl;
|
||||||
|
} else {
|
||||||
|
window.location.href = ReLoginUrl;
|
||||||
|
}
|
||||||
|
// location.href = ReLoginUrl;
|
||||||
} else {
|
} else {
|
||||||
//Message({message: res.data.message, type: 'error'});
|
//Message({message: res.data.message, type: 'error'});
|
||||||
//console.log('err' + res.data.error);
|
//console.log('err' + res.data.error);
|
||||||
|
|||||||
Reference in New Issue
Block a user