Browse Source

fix utils

main^2
yuan_yi 3 years ago
parent
commit
dba87a2572
  1. 6
      code/VideoAccess-VCMP/web/client/src/utils/func.js
  2. 8
      code/VideoAccess-VCMP/web/client/src/utils/index.js

6
code/VideoAccess-VCMP/web/client/src/utils/func.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
export const isAuthorized = (authcode) => { const isAuthorized = (authcode) => {
if (JSON.parse(sessionStorage.getItem('user'))) { if (JSON.parse(sessionStorage.getItem('user'))) {
const { resources } = JSON.parse(sessionStorage.getItem('user')); const { resources } = JSON.parse(sessionStorage.getItem('user'));
return resources.includes(authcode); return resources.includes(authcode);
@ -8,3 +8,7 @@ export const isAuthorized = (authcode) => {
return false; return false;
} }
} }
export default {
isAuthorized
}

8
code/VideoAccess-VCMP/web/client/src/utils/index.js

@ -1,11 +1,13 @@
'use strict'; 'use strict';
import Func from './func'; import { isAuthorized } from './func';
import { AuthorizationCode } from './authCode'; import { AuthorizationCode } from './authCode';
import { ApiTable, RouteTable } from './webapi' import { ApiTable, RouteTable } from './webapi'
export { export {
Func, isAuthorized,
AuthorizationCode,
ApiTable, ApiTable,
RouteTable, RouteTable,
AuthorizationCode,
} }
Loading…
Cancel
Save