Commit 6ff31608 by wangshufen

fixed:修改token校验

parent fc9dffa0
import axios from 'axios';
import { getQueryString } from './utils';
const baseURL = 'http://52.83.169.190:8005 /';
const token = getQueryString('token');
const token = getQueryString('token') || localStorage.getItem('token');
const request = axios.create({
baseURL,
baseURL: 'http://52.83.169.190:8005/',
timeout: 15000,
headers: {
accessToken: token,
......@@ -29,12 +27,12 @@ function checkFetchToken() {
} else {
alert('token校验失败,返回登录页');
// window.open('http://localhost:3000/#/login', '_self');
window.open('http://69.235.144.91:3048/#/login', '_self');
window.open('http://ysplatform.atelligence-ai.com/#/login', '_self');
}
})
.catch(function(err) {
console.log('err', err);
window.open('http://69.235.144.91:3048/#/login', '_self');
window.open('http://ysplatform.atelligence-ai.com/#/login', '_self');
});
}
checkFetchToken();
......@@ -49,7 +47,7 @@ request.interceptors.request.use((config) => {
return config;
} else {
console.log('token为空....');
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