Browse Source

refactor: modify the parameter type of `access` function (#9596)

pull/9605/head
zqran 4 years ago
committed by GitHub
parent
commit
f1c9c3856f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/access.ts

4
src/access.ts

@ -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…
Cancel
Save