|
@@ -6,10 +6,6 @@ let current = [];
|
6
|
6
|
const AuthButton = ({ children, name, noRight }) => {
|
7
|
7
|
const btn = allBtns.filter(x => x.code === name)[0]
|
8
|
8
|
|
9
|
|
- console.log('allBtns: ', allBtns)
|
10
|
|
- console.log('btn: ', btn)
|
11
|
|
- console.log('current: ', current)
|
12
|
|
-
|
13
|
9
|
// 没维护的按钮, 或者不需要权限的按钮直接通过
|
14
|
10
|
// if (!btn || !btn.roles || !btn.roles.length) {
|
15
|
11
|
// return <>{children}</>
|
|
@@ -22,7 +18,6 @@ const AuthButton = ({ children, name, noRight }) => {
|
22
|
18
|
}
|
23
|
19
|
|
24
|
20
|
const hasRight = btn.rolesList.some(x => current.some(y => x.roleId === y))
|
25
|
|
- console.log('hasRight: ', hasRight)
|
26
|
21
|
return hasRight ? <>{children}</> : <>{noRight}</>
|
27
|
22
|
}
|
28
|
23
|
|