You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
655 B
TypeScript
23 lines
655 B
TypeScript
import {IRoute} from "@umijs/max";
|
|
|
|
/**
|
|
* @see https://umijs.org/zh-CN/plugins/plugin-access
|
|
* */
|
|
export default function access(initialState: { currentUser?: API.CurrentUser } | undefined) {
|
|
// const { currentUser } = initialState ?? {};
|
|
// const read_paths = currentUser?.read_paths || []
|
|
// const update_paths = currentUser?.update_paths || []
|
|
return {
|
|
// canReadMenu: read_paths?.includes(history.location.pathname),
|
|
canReadMenu: (route: IRoute)=>{
|
|
// return read_paths?.includes(route.path)
|
|
return true
|
|
},
|
|
canUpdate: (path: string)=>{
|
|
// return update_paths?.includes(path)
|
|
return true
|
|
}
|
|
};
|
|
}
|
|
|