Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
301336c3
Commit
301336c3
authored
Dec 02, 2020
by
wufan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:权限数据存储
parent
24974163
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
19 deletions
+22
-19
src/common/js/permission.js
+2
-2
src/modules/root/App.tsx
+4
-4
src/store/reducers/basicReducer.ts
+16
-13
No files found.
src/common/js/permission.js
View file @
301336c3
...
...
@@ -2,7 +2,7 @@
* @Author: wufan
* @Date: 2020-12-02 10:39:36
* @LastEditors: wufan
* @LastEditTime: 2020-12-02 1
0:40:48
* @LastEditTime: 2020-12-02 1
7: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
'
);
}
}
...
...
src/modules/root/App.tsx
View file @
301336c3
...
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2019-07-10 10:30:49
* @LastEditors: wufan
* @LastEditTime: 2020-12-02 1
6:54:57
* @LastEditTime: 2020-12-02 1
7: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
))
});
}
...
...
src/store/reducers/basicReducer.ts
View file @
301336c3
...
...
@@ -2,7 +2,7 @@
* @Author: wufan
* @Date: 2020-12-02 10:27:44
* @LastEditors: wufan
* @LastEditTime: 2020-12-02 1
5:35:2
4
* @LastEditTime: 2020-12-02 1
7:41:3
4
* @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, {
// user
Info: action.payload,
// authPermissionList: action.payload.storeVOS
,
// storePermissionCodeList,
// permission: new Permission(storePermissionCodeList)
// });
const
storeUserPermissionList
:
any
=
_
.
pluck
(
action
.
payload
,
'groupCode'
)
return
Object
.
assign
({},
state
,
{
userPermission
Info
:
action
.
payload
,
storeUserPermissionList
,
userPermission
:
new
Permission
(
storeUserPermissionList
)
});
case
STORE_GROUP_LIST
:
const
storeGroupList
:
any
=
action
.
payload
;
return
Object
.
assign
({},
state
,
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment