diff --git a/code/VideoAccess-VCMP/web/client/src/utils/func.js b/code/VideoAccess-VCMP/web/client/src/utils/func.js index 5a22ccb..4750606 100644 --- a/code/VideoAccess-VCMP/web/client/src/utils/func.js +++ b/code/VideoAccess-VCMP/web/client/src/utils/func.js @@ -1,10 +1,14 @@ 'use strict'; -export const isAuthorized = (authcode) => { +const isAuthorized = (authcode) => { if (JSON.parse(sessionStorage.getItem('user'))) { const { resources } = JSON.parse(sessionStorage.getItem('user')); return resources.includes(authcode); } else { return false; } +} + +export default { + isAuthorized } \ No newline at end of file diff --git a/code/VideoAccess-VCMP/web/client/src/utils/index.js b/code/VideoAccess-VCMP/web/client/src/utils/index.js index ebded4b..9a588fe 100644 --- a/code/VideoAccess-VCMP/web/client/src/utils/index.js +++ b/code/VideoAccess-VCMP/web/client/src/utils/index.js @@ -1,11 +1,13 @@ 'use strict'; -import Func from './func'; +import { isAuthorized } from './func'; import { AuthorizationCode } from './authCode'; import { ApiTable, RouteTable } from './webapi' export { - Func, + isAuthorized, + + AuthorizationCode, + ApiTable, RouteTable, - AuthorizationCode, } \ No newline at end of file