with-userinfo-auth
v1.0.1
Published
```javascript import WithLoginAuth from "with-login-auth";
Downloads
6
Readme
获取用户信息、用户权限信息组件,包含 loading 交互
Usage
import WithLoginAuth from "with-login-auth";
const Index = () => {
const withLoginAuthPRrops = {
userInfoRequest: {
url: "/updata/4A/getUserAndExtUserByCode",
method: "get",
data: { test: 1 },
},
authRequest: {
url: "/updata/4A/getAuthByUser",
method: "get",
data: { test: 2 },
},
userInfoCallback: (userInfo) => {
console.log(userInfo);
},
authCallback: (auth) => {
console.log(auth);
},
userInfoLoadingWrap: "用户信息获取中...",
authLoadingWrap: "权限信息获取中...",
};
return (
<WithLoginAuth {...withLoginAuthPRrops}>
<BasicLayout />
</WithLoginAuth>
);
};