@lark-apaas/client-toolkit 1.1.32-alpha.1 → 1.1.32-alpha.2
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/lib/hooks/useAppInfo.js
CHANGED
|
@@ -31,13 +31,13 @@ const useAppInfo = ()=>{
|
|
|
31
31
|
setAppInfo(info);
|
|
32
32
|
};
|
|
33
33
|
handleMetaInfoChanged();
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
|
|
34
|
+
const onUpdate = (e)=>{
|
|
35
|
+
const info = e.detail;
|
|
36
|
+
handleMetaInfoChanged(info);
|
|
37
37
|
};
|
|
38
|
-
window.addEventListener('
|
|
38
|
+
window.addEventListener('MiaoDaMetaInfoChanged', onUpdate);
|
|
39
39
|
return ()=>{
|
|
40
|
-
window.removeEventListener('
|
|
40
|
+
window.removeEventListener('MiaoDaMetaInfoChanged', onUpdate);
|
|
41
41
|
};
|
|
42
42
|
}, []);
|
|
43
43
|
return {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AppInfoPayload } from "./common";
|
|
1
2
|
export interface IframeMessage<T = unknown> {
|
|
2
3
|
type: string;
|
|
3
4
|
data: T;
|
|
@@ -55,6 +56,8 @@ export interface ParentApi {
|
|
|
55
56
|
export interface ChildApi {
|
|
56
57
|
getRoutes: () => Promise<any[]>;
|
|
57
58
|
getSourceMap: () => Promise<string>;
|
|
59
|
+
/** 更新应用信息 */
|
|
60
|
+
updateAppInfo: (appInfo: AppInfoPayload) => void;
|
|
58
61
|
apiProxy: {
|
|
59
62
|
api_get: (url: string, config?: any) => Promise<any>;
|
|
60
63
|
api_post: (url: string, data?: any, config?: any) => Promise<any>;
|