From 8290e24d8d00a4d507996e27f6ab918b4339225b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Fri, 14 Sep 2018 10:29:43 +0800 Subject: [PATCH] fix Authorize error in ie11 --- src/components/Authorized/renderAuthorize.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Authorized/renderAuthorize.js b/src/components/Authorized/renderAuthorize.js index 5c5daa68..be373d99 100644 --- a/src/components/Authorized/renderAuthorize.js +++ b/src/components/Authorized/renderAuthorize.js @@ -6,12 +6,12 @@ let CURRENT = 'NULL'; */ const renderAuthorize = Authorized => currentAuthority => { if (currentAuthority) { - if (currentAuthority.constructor.name === 'Function') { + if (typeof currentAuthority === 'function') { CURRENT = currentAuthority(); } if ( - currentAuthority.constructor.name === 'String' || - currentAuthority.constructor.name === 'Array' + Object.prototype.toString.call(currentAuthority) === '[object String]' || + Array.isArray(currentAuthority) ) { CURRENT = currentAuthority; } -- GitLab