Commit 301336c3 by wufan

feat:权限数据存储

parent 24974163
......@@ -2,7 +2,7 @@
* @Author: wufan
* @Date: 2020-12-02 10:39:36
* @LastEditors: wufan
* @LastEditTime: 2020-12-02 10:40:48
* @LastEditTime: 2020-12-02 17:46:27
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -13,7 +13,7 @@ class Permission {
// 添加、编辑、删除排课
ContentClass_Schedule() {
return this.permissionCodes.includes('ContentClass_Schedule');
return this.permissionCodes.includes('ShopStaff');
}
}
......
......@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2019-07-10 10:30:49
* @LastEditors: wufan
* @LastEditTime: 2020-12-02 16:54:57
* @LastEditTime: 2020-12-02 17:31:41
* @Description:
*/
import React, { useContext, useEffect } from 'react';
......@@ -54,9 +54,9 @@ const App: React.FC = (props: any) => {
BaseService.getUserPermission({ storeId, storeUserId }).then((res) => {
console.log(res.result);
const { storeUserPermission } = res.result;
// ctx.dispatch(setStoreGroupList(storeGroupVOS))
// ctx.dispatch(setStoreList(storeVOS))
const {storePermission, storePermissionGroup, storeUserPermission, storeUserPermissionGroup } = res.result;
ctx.dispatch(setStoreGroupPermission(storePermissionGroup))
ctx.dispatch(setStorePermission(storeUserPermissionGroup))
});
}
......
......@@ -2,7 +2,7 @@
* @Author: wufan
* @Date: 2020-12-02 10:27:44
* @LastEditors: wufan
* @LastEditTime: 2020-12-02 15:35:24
* @LastEditTime: 2020-12-02 17:41:34
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -16,21 +16,24 @@ import _ from 'underscore';
import Permission from '@/common/js/permission';
const basicReducer = (state: any, action: any) => {
switch (action.type) {
case STORE_GROUP_PERMISSION:
// const storeGroupList: any = _.pluck(action.payload.storeGroupVOS, 'groupCode')
// return Object.assign({}, state, {
// userInfo: action.payload,
// storeGroupList,
// });
const storePermissionGroupList: any = _.pluck(action.payload, 'groupCode')
return Object.assign({}, state, {
storePermissionInfo: action.payload,
storePermissionGroupList,
groupPermission: new Permission(storePermissionGroupList)
});
case STORE_PERMISSION:
// const storeList: any = _.pluck(action.payload.storeVOS, 'groupCode')
// return Object.assign({}, state, {
// userInfo: action.payload,
// authPermissionList: action.payload.storeVOS,
// storePermissionCodeList,
// permission: new Permission(storePermissionCodeList)
// });
const storeUserPermissionList: any = _.pluck(action.payload, 'groupCode')
return Object.assign({}, state, {
userPermissionInfo: action.payload,
storeUserPermissionList,
userPermission: new Permission(storeUserPermissionList)
});
case STORE_GROUP_LIST:
const storeGroupList: any = action.payload;
return Object.assign({}, state, {
......
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