Commit a05cccab by wangshufen

fixed:修改路由控制

parent 01c80356
...@@ -37,7 +37,6 @@ class HeaderBar extends React.Component { ...@@ -37,7 +37,6 @@ class HeaderBar extends React.Component {
} }
logout = () => { logout = () => {
this.props.appStore.toggleLogin(true) this.props.appStore.toggleLogin(true)
// debugger
console.log(this.props.location); console.log(this.props.location);
// this.props.history.push(this.props.location.pathname) // this.props.history.push(this.props.location.pathname)
this.props.history.push('/login') this.props.history.push('/login')
......
...@@ -176,7 +176,6 @@ export default class SearchDetails extends Component { ...@@ -176,7 +176,6 @@ export default class SearchDetails extends Component {
listData.ligand = ''; listData.ligand = '';
listData.resolution = 0; listData.resolution = 0;
this.setState({ listData }); this.setState({ listData });
// debugger;
let pdbLink = 'http://52.83.169.190:3004/?id=' + JSON.stringify(listData); let pdbLink = 'http://52.83.169.190:3004/?id=' + JSON.stringify(listData);
this.setState({ this.setState({
pdbLink, pdbLink,
......
...@@ -375,7 +375,6 @@ class Home extends React.Component { ...@@ -375,7 +375,6 @@ class Home extends React.Component {
//首页启动调用接口 先checkToken == localStorage.getItem('token') //首页启动调用接口 先checkToken == localStorage.getItem('token')
getTargetSelectList = () => { getTargetSelectList = () => {
// debugger
localStorage.getItem('token') && localStorage.getItem('token') &&
request request
.get('/kinase/target_class/target') .get('/kinase/target_class/target')
......
...@@ -71,6 +71,7 @@ request.interceptors.request.use((config) => { ...@@ -71,6 +71,7 @@ request.interceptors.request.use((config) => {
checkToken(config); checkToken(config);
} else { } else {
console.log('token为空....'); console.log('token为空....');
localStorage.removeItem('token');
window.open('http://69.235.144.91:3048/#/login', '_self'); window.open('http://69.235.144.91:3048/#/login', '_self');
} }
}); });
......
...@@ -68,7 +68,6 @@ export function preloadingImages(arr) { ...@@ -68,7 +68,6 @@ export function preloadingImages(arr) {
/** /**
* 获取URL中指定的参数 * 获取URL中指定的参数
*/ */
export function getQueryString(name) { export function getQueryString(name) {
let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i'); let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
let r = window.location.hash.split('?')[1] && window.location.hash.split('?')[1].match(reg); //获取url中"?"符后的字符串并正则匹配 let r = window.location.hash.split('?')[1] && window.location.hash.split('?')[1].match(reg); //获取url中"?"符后的字符串并正则匹配
......
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