This commit is contained in:
Gao Shan
2022-10-04 00:12:49 +08:00
committed by Gao Shan
parent cde3b77e4d
commit 6e95de664d
123 changed files with 7845 additions and 18 deletions
+9
View File
@@ -0,0 +1,9 @@
/**
* @see https://umijs.org/zh-CN/plugins/plugin-access
* */
export default function access(initialState: { currentUser?: API.CurrentUser } | undefined) {
const { currentUser } = initialState ?? {};
return {
canAdmin: currentUser && currentUser.access === 'admin',
};
}