yuan_yi
3 years ago
2 changed files with 10 additions and 4 deletions
@ -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 |
|||
} |
@ -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…
Reference in new issue