refactor: modify the parameter type of `access` function (#9596)
This commit is contained in:
parent
86b7c871f2
commit
f1c9c3856f
|
|
@ -1,8 +1,8 @@
|
|||
/**
|
||||
* @see https://umijs.org/zh-CN/plugins/plugin-access
|
||||
* */
|
||||
export default function access(initialState: { currentUser?: API.CurrentUser | undefined }) {
|
||||
const { currentUser } = initialState || {};
|
||||
export default function access(initialState: { currentUser?: API.CurrentUser } | undefined) {
|
||||
const { currentUser } = initialState ?? {};
|
||||
return {
|
||||
canAdmin: currentUser && currentUser.access === 'admin',
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue