Commit 6ff31608 by wangshufen

fixed:修改token校验

parent fc9dffa0
import axios from 'axios'; import axios from 'axios';
import { getQueryString } from './utils'; import { getQueryString } from './utils';
const baseURL = 'http://52.83.169.190:8005 /'; const token = getQueryString('token') || localStorage.getItem('token');
const token = getQueryString('token');
const request = axios.create({ const request = axios.create({
baseURL, baseURL: 'http://52.83.169.190:8005/',
timeout: 15000, timeout: 15000,
headers: { headers: {
accessToken: token, accessToken: token,
...@@ -29,12 +27,12 @@ function checkFetchToken() { ...@@ -29,12 +27,12 @@ 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://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://ysplatform.atelligence-ai.com/#/login', '_self');
}); });
} }
checkFetchToken(); checkFetchToken();
...@@ -49,7 +47,7 @@ request.interceptors.request.use((config) => { ...@@ -49,7 +47,7 @@ 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://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