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 } }; }