Commit b61e44e4 by wufan

feat:解决接口依赖问题

parent 0e42e759
/*
* @Author: zhangleyuan
* @Date: 2020-11-27 15:06:31
* @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-07 15:59:26
* @LastEditors: wufan
* @LastEditTime: 2020-12-07 20:09:22
* @Description: 描述一下
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -35,7 +35,7 @@ function PersonalInfoPage() {
const [phone,setPhone] = useState("");
const storeUserId = User.getStoreUserId()
useEffect(() => {
getUserInfo();
storeUserId && getUserInfo();
},[storeUserId])
function getUserInfo(){
const param ={
......
/*
* @Author: 吴文洁
* @Date: 2019-07-10 10:30:49
* @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-04 15:19:59
* @LastEditors: wufan
* @LastEditTime: 2020-12-07 20:09:55
* @Description:
*/
import React, { useContext, useEffect } from 'react';
......@@ -32,7 +32,6 @@ const App: React.FC = (props: any) => {
async function getStoreAndUserInfo(){
await getStoreGroupAndStoreList();
await getUserPermission();
}
function getStoreGroupAndStoreList() {
......@@ -43,14 +42,18 @@ const App: React.FC = (props: any) => {
User.setStoreId(id);
User.setStoreUserId(storeUserId);
console.log("getUserStore",id,storeUserId)
ctx.dispatch(setStoreGroupList(storeGroupVOS))
ctx.dispatch(setStoreList(storeVOS))
ctx.dispatch(setStoreList(storeVOS));
getUserPermission();
});
}
function getUserPermission() {
const storeId = User.getStoreId();
const storeUserId = User.getStoreUserId();
console.log("getUserPermission",storeId,storeUserId)
BaseService.getUserPermission({ storeId, storeUserId }).then((res) => {
console.log(res.result);
......
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