|
@@ -1,7 +1,7 @@
|
|
/*
|
|
/*
|
|
* @Author: your name
|
|
* @Author: your name
|
|
* @Date: 2021-09-03 14:28:27
|
|
* @Date: 2021-09-03 14:28:27
|
|
- * @LastEditTime: 2022-01-05 09:22:09
|
|
|
|
|
|
+ * @LastEditTime: 2022-01-10 14:58:23
|
|
* @LastEditors: Please set LastEditors
|
|
* @LastEditors: Please set LastEditors
|
|
* @Description: In User Settings Edit
|
|
* @Description: In User Settings Edit
|
|
* @FilePath: /MedicalWisdomCheckSys/src/app.tsx
|
|
* @FilePath: /MedicalWisdomCheckSys/src/app.tsx
|
|
@@ -35,7 +35,6 @@ if(history){
|
|
hospSign = history.location.query?.hospSign;
|
|
hospSign = history.location.query?.hospSign;
|
|
if(!hospSign){
|
|
if(!hospSign){
|
|
hospSign = localStorage.getItem('hospSign');
|
|
hospSign = localStorage.getItem('hospSign');
|
|
- console.log({'localStorage':hospSign});
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -75,12 +74,13 @@ export async function getInitialState(): Promise<{
|
|
const fetchUserInfo = async () => {
|
|
const fetchUserInfo = async () => {
|
|
try {
|
|
try {
|
|
const userData = localStorage.getItem('userData');
|
|
const userData = localStorage.getItem('userData');
|
|
|
|
+ console.log({userData});
|
|
if(userData){
|
|
if(userData){
|
|
return JSON.parse(userData);
|
|
return JSON.parse(userData);
|
|
}
|
|
}
|
|
throw Error;
|
|
throw Error;
|
|
} catch (error) {
|
|
} catch (error) {
|
|
- history.push(`${loginPath}?hospSign=${hospSign}`);
|
|
|
|
|
|
+ // history.push(`${loginPath}?hospSign=${hospSign}`);
|
|
}
|
|
}
|
|
return undefined;
|
|
return undefined;
|
|
};
|
|
};
|
|
@@ -138,7 +138,7 @@ const authHeaderInterceptor = (url: string, options: RequestOptionsInit) => {
|
|
const userData = localStorage.getItem('userData');
|
|
const userData = localStorage.getItem('userData');
|
|
let authHeader = {token:''};
|
|
let authHeader = {token:''};
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
if(userData){
|
|
if(userData){
|
|
const {token}:API.CurrentUserData = JSON.parse(userData);
|
|
const {token}:API.CurrentUserData = JSON.parse(userData);
|
|
authHeader.token = token;
|
|
authHeader.token = token;
|
|
@@ -309,9 +309,9 @@ export const layout: RunTimeLayoutConfig = ({ initialState,setInitialState }) =>
|
|
onPageChange:() => {
|
|
onPageChange:() => {
|
|
const { location } = history;
|
|
const { location } = history;
|
|
// 如果没有登录,重定向到 login
|
|
// 如果没有登录,重定向到 login
|
|
- if (!initialState?.currentUser && location.pathname !== loginPath) {
|
|
|
|
- history.push(`${loginPath}?hospSign=${hospSign}`);
|
|
|
|
- }
|
|
|
|
|
|
+ // if (!initialState?.currentUser && location.pathname !== loginPath) {
|
|
|
|
+ // history.push(`${loginPath}?hospSign=${hospSign}`);
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
menu: {
|
|
menu: {
|
|
|
|
|