Commit 301336c3 by wufan

feat:权限数据存储

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