|
@@ -18,32 +18,33 @@ export async function getInitialState(): Promise<{
|
|
|
}> {
|
|
|
const { location } = history;
|
|
|
var token = localStorage.getItem('token');
|
|
|
- // if (location.pathname.indexOf('login') == -1 && !token) {
|
|
|
- // history.push('/login');
|
|
|
- // }
|
|
|
+ if (location.pathname.indexOf('login') == -1 && !token) {
|
|
|
+ history.push('/login');
|
|
|
+ }
|
|
|
if (location.pathname.indexOf('login') > -1 && token) {
|
|
|
history.push('/home');
|
|
|
}
|
|
|
- //debugger;
|
|
|
- let currentUser = {
|
|
|
- appId: 'wxda2ef261ac3cca32',
|
|
|
- companyId: '17fe48afcdde4d6797583c6d6270a035', // ff80c708fe72446eb790b764c3a7b66b,
|
|
|
- loginType: 'app',
|
|
|
- manageUserType: 3,
|
|
|
- name: '赵静',
|
|
|
- openId: 'oDcGY5Qq3Vk-7WKTNsn-lLGNT118',
|
|
|
- phone: '13810794283',
|
|
|
- projectId: 'Pj1101080259', // Pj1101099999
|
|
|
- userId: 'db445a9cd7be4341a14448928014605c',
|
|
|
- };
|
|
|
- let projectId = 'Pj1101080259'; // Pj1101099999
|
|
|
+ debugger;
|
|
|
+ let currentUser = {};
|
|
|
+ // let currentUser = {
|
|
|
+ // appId: 'wxda2ef261ac3cca32',
|
|
|
+ // companyId: '17fe48afcdde4d6797583c6d6270a035', // ff80c708fe72446eb790b764c3a7b66b,
|
|
|
+ // loginType: 'app',
|
|
|
+ // manageUserType: 3,
|
|
|
+ // name: '赵静',
|
|
|
+ // openId: 'oDcGY5Qq3Vk-7WKTNsn-lLGNT118',
|
|
|
+ // phone: '13810794283',
|
|
|
+ // projectId: 'Pj1101080259', // Pj1101099999
|
|
|
+ // userId: 'db445a9cd7be4341a14448928014605c',
|
|
|
+ // };
|
|
|
+ let projectId = ''; // Pj1101099999
|
|
|
if (location.pathname.indexOf('login') == -1 && token) {
|
|
|
var localUser = localStorage.getItem('user') || '';
|
|
|
currentUser = JSON.parse(localUser);
|
|
|
projectId = currentUser?.projectId;
|
|
|
}
|
|
|
let companyConfig = {};
|
|
|
- if (currentUser.userId) {
|
|
|
+ if (currentUser?.userId) {
|
|
|
const res = await queryTenantData(currentUser);
|
|
|
companyConfig = res.data;
|
|
|
}
|