From a8f818048539f4848e38b6302e9a392703aa69d3 Mon Sep 17 00:00:00 2001 From: guowenfh Date: Thu, 14 Jun 2018 00:37:41 +0800 Subject: [PATCH] fix checkPermissions if 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 8a6c9780..0c3b9a4c 100644 --- a/src/components/Authorized/CheckPermissions.js +++ b/src/components/Authorized/CheckPermissions.js @@ -50,12 +50,12 @@ const checkPermissions = (authority, currentAuthority, target, Exception) => { try { const bool = authority(currentAuthority); if (bool) { + // 函数执行后返回值是 Promise + if (isPromise(bool)) { + return ; + } return target; } - // 函数执行后返回值是 Promise - if (isPromise(bool)) { - return ; - } return Exception; } catch (error) { throw error; -- GitLab