yuan_yi
3 years ago
2 changed files with 10 additions and 4 deletions
@ -1,10 +1,14 @@ |
|||||
'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); |
||||
} else { |
} else { |
||||
return false; |
return false; |
||||
} |
} |
||||
|
} |
||||
|
|
||||
|
export default { |
||||
|
isAuthorized |
||||
} |
} |
@ -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…
Reference in new issue