Closed wanglianjie91 closed 2 years ago
"@umijs/max": "^4.0.2"
access.ts
// permission1 是动态获取的 export default function access(initialState: { permissions?: string[] }) { const { permissions } = initialState || {}; console.log(permissions); // 能打印最新值 return { canVisite: (foo: any) => { console.log(permissions); //只有初始值 return permissions?.includes(foo.key); }, }; }
清缓存, 升级到4.0.8。 解决了。
"@umijs/max": "^4.0.2"
access.ts