Browse Source

fix utils

release_0.0.1
yuan_yi 3 years ago
parent
commit
052d73e231
  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,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
}

8
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,
}
Loading…
Cancel
Save