|
@@ -1,6 +1,7 @@
|
|
import { PageLoading } from '@ant-design/pro-layout';
|
|
import { PageLoading } from '@ant-design/pro-layout';
|
|
import { history, useModel } from 'umi';
|
|
import { history, useModel } from 'umi';
|
|
import { queryTenantData } from '@/services/sagacare_service/member';
|
|
import { queryTenantData } from '@/services/sagacare_service/member';
|
|
|
|
+import { projectObj } from '@/config/api.js';
|
|
|
|
|
|
/** 获取用户信息比较慢的时候会展示一个 loading */
|
|
/** 获取用户信息比较慢的时候会展示一个 loading */
|
|
export const initialStateConfig = {
|
|
export const initialStateConfig = {
|
|
@@ -24,24 +25,14 @@ export async function getInitialState(): Promise<{
|
|
if (location.pathname.indexOf('login') > -1 && token) {
|
|
if (location.pathname.indexOf('login') > -1 && token) {
|
|
history.push('/home');
|
|
history.push('/home');
|
|
}
|
|
}
|
|
- debugger;
|
|
|
|
let currentUser = {};
|
|
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
|
|
let projectId = ''; // Pj1101099999
|
|
if (location.pathname.indexOf('login') == -1 && token) {
|
|
if (location.pathname.indexOf('login') == -1 && token) {
|
|
var localUser = localStorage.getItem('user') || '';
|
|
var localUser = localStorage.getItem('user') || '';
|
|
currentUser = JSON.parse(localUser);
|
|
currentUser = JSON.parse(localUser);
|
|
projectId = currentUser?.projectId;
|
|
projectId = currentUser?.projectId;
|
|
|
|
+ projectObj.projectId = currentUser?.projectId;
|
|
}
|
|
}
|
|
let companyConfig = {};
|
|
let companyConfig = {};
|
|
if (currentUser?.userId) {
|
|
if (currentUser?.userId) {
|