Browse Source
refactor: modify the parameter type of `access` function (#9596)
pull/9605/head
zqran
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
src/access.ts
|
|
@ -1,8 +1,8 @@ |
|
|
/** |
|
|
/** |
|
|
* @see https://umijs.org/zh-CN/plugins/plugin-access
|
|
|
* @see https://umijs.org/zh-CN/plugins/plugin-access
|
|
|
* */ |
|
|
* */ |
|
|
export default function access(initialState: { currentUser?: API.CurrentUser | undefined }) { |
|
|
export default function access(initialState: { currentUser?: API.CurrentUser } | undefined) { |
|
|
const { currentUser } = initialState || {}; |
|
|
const { currentUser } = initialState ?? {}; |
|
|
return { |
|
|
return { |
|
|
canAdmin: currentUser && currentUser.access === 'admin', |
|
|
canAdmin: currentUser && currentUser.access === 'admin', |
|
|
}; |
|
|
}; |
|
|
|