Commit e08523de by wangshufen

fixed:修改token校验

parent 72f1dc61
...@@ -18,7 +18,7 @@ function disableF12() { ...@@ -18,7 +18,7 @@ function disableF12() {
// disableF12(); // disableF12();
//对axios二次封装 //对axios二次封装
const token = getQueryString('token'); const token = getQueryString('token') || localStorage.getItem('token');
function checkFetchToken() { function checkFetchToken() {
fetch('http://69.235.144.91:8048/yszh-login/auth/checkToken', { fetch('http://69.235.144.91:8048/yszh-login/auth/checkToken', {
...@@ -36,30 +36,15 @@ function checkFetchToken() { ...@@ -36,30 +36,15 @@ function checkFetchToken() {
} else { } else {
alert('token校验失败,返回登录页'); alert('token校验失败,返回登录页');
// window.open('http://localhost:3000/#/login', '_self'); // window.open('http://localhost:3000/#/login', '_self');
window.open('http://69.235.144.91:3048/#/login', '_self'); // window.open('http://69.235.144.91:3048/#/login', '_self');
window.open('http://ysplatform.atelligence-ai.com/#/login', '_self');
} }
}) })
.catch(function(err) { .catch(function(err) {
console.log('err', err); console.log('err', err);
window.open('http://69.235.144.91:3048/#/login', '_self'); // window.open('http://69.235.144.91:3048/#/login', '_self');
window.open('http://ysplatform.atelligence-ai.com/#/login', '_self');
}); });
// request
// .get('http://69.235.144.91:8048/yszh-login/auth/checkToken')
// .then((res) => {
// console.log('--res', res);
// if (res.data.code === 200) {
// console.log('token 检验通过');
// return config;
// } else {
// console.log('token校验没通过 返回登录页');
// window.open('http://69.235.144.91:3048/#/login', '_self');
// }
// })
// .catch((err) => {
// console.log('token校验没通过 返回登录页');
// window.open('http://69.235.144.91:3048/#/login', '_self');
// console.log('err', err);
// });
} }
checkFetchToken(); checkFetchToken();
const baseURL = 'http://52.83.169.190:8002/'; //线上正式环境 const baseURL = 'http://52.83.169.190:8002/'; //线上正式环境
...@@ -85,7 +70,8 @@ request.interceptors.request.use((config) => { ...@@ -85,7 +70,8 @@ request.interceptors.request.use((config) => {
return config; return config;
} else { } else {
console.log('token为空....'); console.log('token为空....');
window.open('http://69.235.144.91:3048/#/login', '_self'); // window.open('http://69.235.144.91:3048/#/login', '_self');
window.open('http://ysplatform.atelligence-ai.com/#/login', '_self');
} }
}); });
......
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