|
|
|
@ -49,11 +49,11 @@ const checkPermissions = (authority, currentAuthority, target, Exception) => { |
|
|
|
if (typeof authority === 'function') { |
|
|
|
try { |
|
|
|
const bool = authority(currentAuthority); |
|
|
|
// 函数执行后返回值是 Promise
|
|
|
|
if (isPromise(bool)) { |
|
|
|
return <PromiseRender ok={target} error={Exception} promise={bool} />; |
|
|
|
} |
|
|
|
if (bool) { |
|
|
|
// 函数执行后返回值是 Promise
|
|
|
|
if (isPromise(bool)) { |
|
|
|
return <PromiseRender ok={target} error={Exception} promise={bool} />; |
|
|
|
} |
|
|
|
return target; |
|
|
|
} |
|
|
|
return Exception; |
|
|
|
|