beer-assembly-biz 1.1.1-alpha.18 → 1.1.1-alpha.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AppLayout.d.ts CHANGED
@@ -78,6 +78,10 @@ export declare type LayoutProps = {
78
78
  * 子路径路径分割符号, 用去区分是否子路径判断子路径的菜单归属
79
79
  */
80
80
  pathPartition: string[];
81
+ /**
82
+ * 请求获取用户信息
83
+ */
84
+ requestUser: () => Promise<UserInfo>;
81
85
  /**
82
86
  * 左侧: Logo样式
83
87
  */
@@ -108,10 +112,6 @@ export declare type LayoutProps = {
108
112
  * @param path 路径.
109
113
  */
110
114
  toLink?: (path: string) => void;
111
- /**
112
- * 请求获取用户信息
113
- */
114
- requestUser?: () => Promise<UserInfo>;
115
115
  /**
116
116
  * 请求获取菜单信息
117
117
  * @param appCode 应用代码
package/AppLayout.js CHANGED
@@ -99,8 +99,8 @@ const Component = (props) => {
99
99
  }, [menus, props.path]);
100
100
  // 更新属性触发: 请求用户信息
101
101
  useEffect(() => {
102
- props?.requestUser?.()
103
- ?.then(userInfo => {
102
+ props.requestUser()
103
+ .then(userInfo => {
104
104
  // 更新缓存到Session
105
105
  if (userInfo === undefined || userInfo?.id === undefined) {
106
106
  return;
@@ -108,7 +108,7 @@ const Component = (props) => {
108
108
  setUserInfo(userInfo);
109
109
  sessionStorage.setItem('SESSION', JSON.stringify(userInfo));
110
110
  });
111
- }, [props?.requestUser]);
111
+ }, []);
112
112
  return React.createElement(React.Fragment, null,
113
113
  contextHolder,
114
114
  React.createElement(ProLayout, { className: css `
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "beer-assembly-biz",
3
3
  "private": false,
4
- "version": "1.1.1-alpha.18",
4
+ "version": "1.1.1-alpha.19",
5
5
  "scripts": {
6
6
  "pub-w": "tsc && copy package.json .\\dist\\package.json && npm publish ./dist",
7
7
  "pub-m": "tsc && cp -a src/icon ./dist && cp -a src/fonts ./dist && cp -a src/images ./dist && cp package.json ./dist/package.json && npm publish ./dist"