Commit b61e44e4 by wufan

feat:解决接口依赖问题

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