网上的解决方案是
export function getAuthority() {
// return localStorage.getItem('antd-pro-authority') || ['admin', 'user'];
return localStorage.getItem('antd-pro-authority') || 'guest'; //修改这里为guest.
}
export function setAuthority(authority) {
return localStorage.setItem('antd-pro-authority', authority);
}
试过之后发现 登陆成功后跳转不了,只有admin的时候才可以跳转、
1.方案一,配置路由,设置首页为登录页
2.方案二,在首页里做判断,未登录跳转到登录页
这两种方案不知道大神有没有具体写的代码可以提供
1.方案一把默认授权的admin给删掉
2.方案二在首页的effects里做判断,然后使用window.location.href