From 6bf92751fe8dfa0624285268968a1fd7a8a7e7e5 Mon Sep 17 00:00:00 2001
From: Mr Ke <kelq@hugeinfo.com.cn>
Date: Tue, 20 Oct 2020 14:39:49 +0800
Subject: [PATCH] 修改默认人员头像

---
 src/api/request.js |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/api/request.js b/src/api/request.js
index 5d6752d..10f16d4 100644
--- a/src/api/request.js
+++ b/src/api/request.js
@@ -3,7 +3,9 @@
 import { message } from 'antd';
 import { NetworkState, BASE_URL, MockUrl } from './httpurl';
 
+import { createHashHistory } from 'history';
 const CODE_SUCCESS = '200';
+const history = createHashHistory();
 
 let recognitionParams = [].reduce((p, n) => {
   if (eval(n)) {
@@ -64,8 +66,7 @@
         code == '10003'
       ) {
         // token失效重新返回登录页面
-        // this.props.history.push({ pathname: '/login' });
-        window.location.href = window.location.origin + '#/login';
+        history.push('/login');
       } else {
         message.warning(msg);
         return false;
@@ -73,6 +74,6 @@
     })
     .catch((err) => {
       console.log(err);
-      window.location.href = window.location.origin + '#/login';
+      // history.push('/login');
     });
 }

--
Gitblit v1.8.0