Blame view

src/access.ts 331 Bytes
calmound authored
1
2
3
export default (initialState: API.UserInfo) => {
  // 在这里按照初始化数据定义项目中的权限,统一管理
  // 参考文档 https://umijs.org/docs/max/access
zhongnanhuang authored
4
5
  const { roleSmallVO } = initialState;
zhongnanhuang authored
6
  console.log(roleSmallVO?.code === 'admin');
calmound authored
7
  return {
zhongnanhuang authored
8
    canReadAdmin: roleSmallVO?.code === 'admin',
calmound authored
9
10
  };
};