【修改】登录权限
This commit is contained in:
+18
-4
@@ -67,7 +67,21 @@ instance.interceptors.response.use(function (response) {
|
|||||||
if (response.data.respCode === '0') {
|
if (response.data.respCode === '0') {
|
||||||
return response.data
|
return response.data
|
||||||
} else if (response.data.respCode === '-1') {
|
} else if (response.data.respCode === '-1') {
|
||||||
Message.error(response.data.message)
|
// Message.error(response.data.message)
|
||||||
|
// if (response.data.status == 401) {
|
||||||
|
store.commit('saveUserInfo', null)
|
||||||
|
store.commit('saveUserInfo', null)
|
||||||
|
store.commit('savePathUrl', null)
|
||||||
|
store.commit('setHandleProcess', null)
|
||||||
|
router.push('/login')
|
||||||
|
Message.error(response.data.message)
|
||||||
|
// window.open(BASE_URL.BASE_CHANGAN + "/logout?service=" + BASE_URL.BASE_LOCAL + "/login?loginType=1", '_self');
|
||||||
|
// var url = 'http://192.168.144.22:9966/login?loginType=1'
|
||||||
|
// // var url = 'http://10.64.23.30:7766/home'
|
||||||
|
//
|
||||||
|
// return window.open('http://192.168.144.29:9090/cas/login?service='+url, '_self');
|
||||||
|
// // return window.open('https://caddmuat.changan.com.cn/cas/login?service='+url, '_self');
|
||||||
|
// }
|
||||||
return Promise.reject(response)
|
return Promise.reject(response)
|
||||||
} else {
|
} else {
|
||||||
return response
|
return response
|
||||||
@@ -85,7 +99,8 @@ instance.interceptors.response.use(function (response) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 登录过期
|
// 登录过期
|
||||||
if (error.response.status === 401) {
|
console.log( error.response.data.status,"error.response")
|
||||||
|
if (error.response.data.status == 401) {
|
||||||
store.commit('saveUserInfo', null)
|
store.commit('saveUserInfo', null)
|
||||||
store.commit('saveUserInfo', null)
|
store.commit('saveUserInfo', null)
|
||||||
store.commit('savePathUrl', null)
|
store.commit('savePathUrl', null)
|
||||||
@@ -114,12 +129,11 @@ instance.interceptors.response.use(function (response) {
|
|||||||
// return window.open('http://192.168.144.29:9090/cas/login?service='+url, '_self');
|
// return window.open('http://192.168.144.29:9090/cas/login?service='+url, '_self');
|
||||||
// // return window.open('https://caddmuat.changan.com.cn/cas/login?service='+url, '_self');
|
// // return window.open('https://caddmuat.changan.com.cn/cas/login?service='+url, '_self');
|
||||||
}
|
}
|
||||||
|
console.log(error,"302 Found")
|
||||||
|
|
||||||
// 判断超时
|
// 判断超时
|
||||||
if (error.code === 'ECONNABORTED' && error.message.indexOf('timeout') !== -1 && !error.config._retry) {
|
if (error.code === 'ECONNABORTED' && error.message.indexOf('timeout') !== -1 && !error.config._retry) {
|
||||||
Message.error(error.message)
|
Message.error(error.message)
|
||||||
} else {
|
|
||||||
Message.error(error.message)
|
|
||||||
}
|
}
|
||||||
return Promise.reject(error)
|
return Promise.reject(error)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user