Commit fab31a41 by zhangleyuan

feat:处理店铺员工显示不存在的问题

parent 29fec6f1
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-31 09:34:25 * @Date: 2020-08-31 09:34:25
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-06-21 19:38:53 * @LastEditTime: 2021-06-22 11:16:53
* @Description: * @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -12,7 +12,6 @@ import { PREFIX, USER_PREFIX } from '@/domains/basic-domain/constants'; ...@@ -12,7 +12,6 @@ import { PREFIX, USER_PREFIX } from '@/domains/basic-domain/constants';
declare var window:any; declare var window:any;
class User { class User {
getStoreId() { getStoreId() {
console.log('storeid',window.currentStoreUserInfo.storeId)
return window.currentStoreUserInfo.storeId || Storage.get(`${PREFIX}_storeId`); return window.currentStoreUserInfo.storeId || Storage.get(`${PREFIX}_storeId`);
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-04-27 20:35:34 * @Date: 2020-04-27 20:35:34
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-06-22 10:04:27 * @LastEditTime: 2021-06-22 11:43:51
* @Description: * @Description:
*/ */
...@@ -25,6 +25,7 @@ import Service from "@/common/js/service"; ...@@ -25,6 +25,7 @@ import Service from "@/common/js/service";
declare var getParameterByName: any; declare var getParameterByName: any;
declare var window: any; declare var window: any;
if(!window.currentStoreUserInfo){ if(!window.currentStoreUserInfo){
console.log('我走进了此流程')
window.currentStoreUserInfo = {} window.currentStoreUserInfo = {}
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2019-07-10 10:30:49 * @Date: 2019-07-10 10:30:49
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-06-21 20:09:58 * @LastEditTime: 2021-06-22 10:58:48
* @Description: * @Description:
*/ */
import React, { useContext, useEffect, useState } from 'react'; import React, { useContext, useEffect, useState } from 'react';
...@@ -21,7 +21,6 @@ import Bus from '@/core/tbus'; ...@@ -21,7 +21,6 @@ import Bus from '@/core/tbus';
import { func } from 'prop-types'; import { func } from 'prop-types';
declare var window: any; declare var window: any;
// window.currentStoreUserInfo = {};
const App: React.FC = (props: any) => { const App: React.FC = (props: any) => {
const [storeUserId, setStoreUserId] = useState('') const [storeUserId, setStoreUserId] = useState('')
...@@ -87,9 +86,9 @@ const App: React.FC = (props: any) => { ...@@ -87,9 +86,9 @@ const App: React.FC = (props: any) => {
function setCurrentStoreUserInfo(storeId:any,storeUserId:any){ function setCurrentStoreUserInfo(storeId:any,storeUserId:any){
window.currentStoreUserInfo.storeId = storeId; window.currentStoreUserInfo.storeId = storeId;
window.currentStoreUserInfo.storeUserId = storeUserId; window.currentStoreUserInfo.storeUserId = storeUserId;
window.currentStoreUserInfo.userId = User.getUserId(); // window.currentStoreUserInfo.userId = User.getUserId();
window.currentStoreUserInfo.token = User.getToken(); // window.currentStoreUserInfo.token = User.getToken();
window.currentStoreUserInfo.enterpriseId = User.getEnterpriseId(); // window.currentStoreUserInfo.enterpriseId = User.getEnterpriseId();
} }
function getStoreGroupAndStoreList() { function getStoreGroupAndStoreList() {
......
...@@ -179,7 +179,9 @@ export default class CollegeManagePage extends React.Component { ...@@ -179,7 +179,9 @@ export default class CollegeManagePage extends React.Component {
return null; return null;
}; };
User.setStoreId(item.id); User.setStoreId(item.id);
User.setStoreUserId(item.storeUserId);
window.currentStoreUserInfo.storeId = item.id; window.currentStoreUserInfo.storeId = item.id;
window.currentStoreUserInfo.storeUserId = item.storeUserId;
window.RCHistory.push('/home') window.RCHistory.push('/home')
}} }}
> >
...@@ -197,7 +199,9 @@ export default class CollegeManagePage extends React.Component { ...@@ -197,7 +199,9 @@ export default class CollegeManagePage extends React.Component {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
User.setStoreId(item.id); User.setStoreId(item.id);
User.setStoreUserId(item.storeUserId);
window.currentStoreUserInfo.storeId = item.id; window.currentStoreUserInfo.storeId = item.id;
window.currentStoreUserInfo.storeUserId = item.storeUserId;
window.RCHistory.push('/college-info') window.RCHistory.push('/college-info')
}} }}
>编辑</span> >编辑</span>
...@@ -252,7 +256,9 @@ export default class CollegeManagePage extends React.Component { ...@@ -252,7 +256,9 @@ export default class CollegeManagePage extends React.Component {
return null; return null;
}; };
User.setStoreId(item.id); User.setStoreId(item.id);
User.setStoreUserId(item.storeUserId);
window.currentStoreUserInfo.storeId = item.id; window.currentStoreUserInfo.storeId = item.id;
window.currentStoreUserInfo.storeUserId = item.storeUserId;
window.RCHistory.push('/home') window.RCHistory.push('/home')
}} }}
> >
...@@ -270,7 +276,9 @@ export default class CollegeManagePage extends React.Component { ...@@ -270,7 +276,9 @@ export default class CollegeManagePage extends React.Component {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
User.setStoreId(item.id); User.setStoreId(item.id);
User.setStoreUserId(item.storeUserId);
window.currentStoreUserInfo.storeId = item.id; window.currentStoreUserInfo.storeId = item.id;
window.currentStoreUserInfo.storeUserId = item.storeUserId;
window.RCHistory.push('/college-info') window.RCHistory.push('/college-info')
}} }}
>编辑</span> >编辑</span>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2019-09-10 18:26:03 * @Date: 2019-09-10 18:26:03
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-06-21 17:05:59 * @LastEditTime: 2021-06-22 11:07:28
* @Description: * @Description:
*/ */
import React, { useRef, useContext, useEffect, useState } from "react"; import React, { useRef, useContext, useEffect, useState } from "react";
...@@ -272,6 +272,12 @@ function Header(props) { ...@@ -272,6 +272,12 @@ function Header(props) {
setStoreId(e.target.value) setStoreId(e.target.value)
User.setStoreId(e.target.value); User.setStoreId(e.target.value);
window.currentStoreUserInfo.storeId = e.target.value; window.currentStoreUserInfo.storeId = e.target.value;
list.map((item)=>{
if(item.id === e.target.value){
User.setStoreUserId(item.storeUserId);
window.currentStoreUserInfo.storeUserId = item.storeUserId;
}
})
window.RCHistory.push('/home'); window.RCHistory.push('/home');
window.location.reload(); window.location.reload();
}} }}
......
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