Browse Source

fix chechPermissions.js isPromise(bool)

pull/1697/head
guowenfh 8 years ago
committed by 陈帅
parent
commit
e685dc6881
  1. 8
      src/components/Authorized/CheckPermissions.js

8
src/components/Authorized/CheckPermissions.js

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

Loading…
Cancel
Save