From e685dc6881cfb72a0c1d7a5657e0989d6659dd0f Mon Sep 17 00:00:00 2001 From: guowenfh Date: Thu, 14 Jun 2018 00:40:37 +0800 Subject: [PATCH] fix chechPermissions.js isPromise(bool) --- src/components/Authorized/CheckPermissions.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Authorized/CheckPermissions.js b/src/components/Authorized/CheckPermissions.js index 0c3b9a4c..06dc0ab9 100644 --- a/src/components/Authorized/CheckPermissions.js +++ b/src/components/Authorized/CheckPermissions.js @@ -49,11 +49,11 @@ const checkPermissions = (authority, currentAuthority, target, Exception) => { if (typeof authority === 'function') { try { const bool = authority(currentAuthority); + // 函数执行后返回值是 Promise + if (isPromise(bool)) { + return ; + } if (bool) { - // 函数执行后返回值是 Promise - if (isPromise(bool)) { - return ; - } return target; } return Exception; -- GitLab