quick-platform 1.0.46 → 1.0.47
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/dist/application/index.d.ts +8 -8
- package/dist/application/manage.d.ts +3 -3
- package/dist/business/index.d.ts +7 -53
- package/dist/components/i18n.d.ts +1 -1
- package/dist/index.js +8 -2
- package/dist/quick-platform.cjs.development.js +1379 -0
- package/dist/quick-platform.cjs.development.js.map +1 -0
- package/dist/quick-platform.cjs.production.min.js +2 -0
- package/dist/quick-platform.cjs.production.min.js.map +1 -0
- package/dist/quick-platform.esm.js +1360 -0
- package/dist/quick-platform.esm.js.map +1 -0
- package/dist/utils/i18n.d.ts +2 -2
- package/dist/utils/image.d.ts +1 -1
- package/dist/utils/request.d.ts +4 -4
- package/dist/utils/utils.d.ts +1 -1
- package/package.json +4 -3
- package/src/business/index.ts +2 -1
- package/src/components/LocalDebug.ts +1 -1
- package/src/utils/i18n.ts +3 -2
- package/dist/config.js +0 -2
- package/dist/config.js.map +0 -1
- package/dist/index-543d110b.js +0 -547
- package/dist/index-543d110b.js.map +0 -1
- package/dist/index-be61d86b.js +0 -2
- package/dist/index-be61d86b.js.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
import { intApp, getCurrentApp } from './manage';
|
|
4
4
|
import { installI18n } from '../utils/i18n';
|
|
5
5
|
export declare const loadApp: (name: string, container: HTMLElement, props?: {
|
|
6
|
-
host?: string
|
|
7
|
-
base?: string
|
|
8
|
-
env?: string
|
|
9
|
-
entry?: string
|
|
10
|
-
}
|
|
6
|
+
host?: string;
|
|
7
|
+
base?: string;
|
|
8
|
+
env?: string;
|
|
9
|
+
entry?: string;
|
|
10
|
+
}) => import("single-spa").Parcel<import("single-spa").CustomProps>;
|
|
11
11
|
export declare const registerApp: (options: {
|
|
12
12
|
name: string;
|
|
13
|
-
env?: string
|
|
13
|
+
env?: string;
|
|
14
14
|
i18n?: {
|
|
15
|
-
global?: boolean
|
|
15
|
+
global?: boolean;
|
|
16
16
|
onReady?(hook: ReturnType<typeof installI18n>): Promise<any>;
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
18
|
lifecycles: {
|
|
19
19
|
mount?(props: any): Promise<any>;
|
|
20
20
|
unmount?(props: any): Promise<any>;
|
|
@@ -11,9 +11,9 @@ declare class App {
|
|
|
11
11
|
get isRoot(): boolean;
|
|
12
12
|
addChildren(child: App): void;
|
|
13
13
|
removeChildren(name: string): void;
|
|
14
|
-
on:
|
|
15
|
-
once:
|
|
16
|
-
off:
|
|
14
|
+
on: any;
|
|
15
|
+
once: any;
|
|
16
|
+
off: any;
|
|
17
17
|
/***
|
|
18
18
|
* 向父级通信
|
|
19
19
|
*/
|
package/dist/business/index.d.ts
CHANGED
|
@@ -1,46 +1,14 @@
|
|
|
1
1
|
import { UserInfo } from './declare';
|
|
2
2
|
export declare const login: (userInfo: UserInfo) => void;
|
|
3
3
|
export declare const getUserInfo: () => Partial<any>;
|
|
4
|
-
export declare const getStaffInfo: () => Partial<{
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
firstName: string;
|
|
8
|
-
id: string;
|
|
9
|
-
name: string;
|
|
10
|
-
role: string;
|
|
11
|
-
roleList: string[];
|
|
12
|
-
storeId: number;
|
|
13
|
-
userId: string;
|
|
14
|
-
}>;
|
|
15
|
-
export declare const getStoreInfo: () => Partial<{
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
city: string;
|
|
18
|
-
id: number;
|
|
19
|
-
platform: string;
|
|
20
|
-
productCategory: string;
|
|
21
|
-
storeName: string;
|
|
22
|
-
timezone: string;
|
|
23
|
-
}>;
|
|
24
|
-
export declare const getStoreLicense: () => Partial<{
|
|
25
|
-
storeId: number;
|
|
26
|
-
name: string;
|
|
27
|
-
enName: string;
|
|
28
|
-
expireTime: string;
|
|
29
|
-
daysToRemain: number;
|
|
30
|
-
remainExpire: boolean;
|
|
31
|
-
licenceId: number;
|
|
32
|
-
productCategory: string;
|
|
33
|
-
validInviteCode: any;
|
|
34
|
-
unLimitedLicence: boolean;
|
|
35
|
-
ultimate: boolean;
|
|
36
|
-
licenceType: string;
|
|
37
|
-
useBalance: number;
|
|
38
|
-
}>;
|
|
4
|
+
export declare const getStaffInfo: () => Partial<{}>;
|
|
5
|
+
export declare const getStoreInfo: () => Partial<{}>;
|
|
6
|
+
export declare const getStoreLicense: () => Partial<{}>;
|
|
39
7
|
export declare const hasAuth: (code: string) => boolean;
|
|
40
8
|
export declare const getSystem: () => {
|
|
41
|
-
oem: string
|
|
42
|
-
env: string
|
|
43
|
-
lang: "zh-CN" | "en-US" | "ko" | "ja" | "zh-TW";
|
|
9
|
+
oem: string;
|
|
10
|
+
env: string;
|
|
11
|
+
lang: "zh-CN" | "en-US" | "ko" | "ja" | "zh-TW" | "ind";
|
|
44
12
|
token: string;
|
|
45
13
|
requestTokenKey: string;
|
|
46
14
|
storeId: string;
|
|
@@ -53,20 +21,6 @@ export declare const License: {
|
|
|
53
21
|
isFree: () => boolean;
|
|
54
22
|
isProfessional: () => boolean;
|
|
55
23
|
isCredits: () => boolean;
|
|
56
|
-
getLicense: () => Partial<{
|
|
57
|
-
storeId: number;
|
|
58
|
-
name: string;
|
|
59
|
-
enName: string;
|
|
60
|
-
expireTime: string;
|
|
61
|
-
daysToRemain: number;
|
|
62
|
-
remainExpire: boolean;
|
|
63
|
-
licenceId: number;
|
|
64
|
-
productCategory: string;
|
|
65
|
-
validInviteCode: any;
|
|
66
|
-
unLimitedLicence: boolean;
|
|
67
|
-
ultimate: boolean;
|
|
68
|
-
licenceType: string;
|
|
69
|
-
useBalance: number;
|
|
70
|
-
}>;
|
|
24
|
+
getLicense: () => Partial<{}>;
|
|
71
25
|
isOEM(): boolean;
|
|
72
26
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const I18nFC: (text: string, data?: Record<string, any>
|
|
1
|
+
declare const I18nFC: (text: string, data?: Record<string, any>) => any;
|
|
2
2
|
export default I18nFC;
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t,n,r,o=require("./index-be61d86b.js"),i=require("qiankun"),a=e(require("eventemitter3")),u=require("react"),c=e(u),s=require("@ant-design/icons"),l=e(require("heic2any")),f=e(require("axios")),d=!!window.__POWERED_BY_QIANKUN__,p=function(e,t,n){var r;return e&&t?Object.assign(n||{},((r={})[e]=t,r)):n||{}},m=(0,eval)("this"),h=m.quick_qiankun_manage||(m.quick_qiankun_manage=new Map),g=function(){function e(e,t){this.children=[],this.cacheMap=new Map,this.emitter=new a,this.on=this.emitter.on.bind(this.emitter),this.once=this.emitter.once.bind(this.emitter),this.off=this.emitter.off.bind(this.emitter),this.name=e,t&&(this.parent=this.getParent(t),this.parent.addChildren(this)),h.set(e,this)}var t=e.prototype;return t.getParent=function(t){if("root"===t&&!h.has(t)){var n=new e("root","");return h.set(t,n),n}if(!h.has(t))throw new Error("quick micro app manage error:"+t+" 应用未加载!");return h.get(t)},t.addChildren=function(e){this.children.push(e)},t.removeChildren=function(e){this.children=this.children.filter((function(t){return t.name!==e}))},t.trigger=function(e,t){this.parent&&this.parent.emitter.emit(e,t)},t.broadcast=function(e,t){for(var n=0,r=this.children.length;n<r;n++)this.children[n].emitter.emit(e,t)},t.cache=function(e,t){return void 0!==t&&this.cacheMap.set(e,t),this.cacheMap.get(e)},t.destroy=function(){for(this.emitter.removeAllListeners(),this.cacheMap.clear();this.children.length;)this.children.pop().destroy();this.parent&&this.parent.removeChildren(this.name)},o._createClass(e,[{key:"root",get:function(){for(var e=this;null!=(t=e)&&t.parent;){var t;e=e.parent}return e}},{key:"isRoot",get:function(){return this.root.name===this.name}}])}(),v=function(e){var n=window,r=n.quick_qiankun_parent_cache||n.quick_qiankun_parent_app||"root";t||(t=new g(e,r),n.quick_qiankun_parent_app=e,n.quick_qiankun_parent_cache=r)},_=function(){return t||h.get("root")||function(){var e=new g("root");return h.set("root",e),e}()},y=function(e){var t=window.localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){console.error(e)}return null};!function(e){e[e.Trial=1]="Trial",e[e.Free=2]="Free",e[e.Basic=3]="Basic",e[e.Professional=4]="Professional",e[e.Ultimate=5]="Ultimate",e[e.FreeCode=13]="FreeCode",e[e.Starter=14]="Starter",e[e.Growth=15]="Growth",e[e.Enterprise=6]="Enterprise"}(n||(n={})),function(e){e.Enterprise="ENTERPRISE",e.PLG="PLG"}(r||(r={}));var w=[n.Free,n.FreeCode,n.Starter,n.Growth],b=function(e){return void 0!==e.licenceId&&w.includes(e.licenceId)},k=function(e){return!b(e)},E=function(e){return n.Enterprise===e.licenceId},C=function(e){return n.Free===e.licenceId},I=function(e){return n.Professional===e.licenceId},q=function(e){return!(r.Enterprise===e.licenceType&&1===e.useBalance)},P=function(e){var t,n,r=null==(t=_())?void 0:t.root;null!=(n=_())&&n.isRoot||console.warn("quick platform login warn:current App is not Root App. Invalid login!",_()),r&&(null==r||r.cache("userinfo",e))},S=function(e){return function(){var t,n=null==(t=_())?void 0:t.root;n||console.warn("quick platform warn:root App not found!!!");var r=null==n?void 0:n.cache("userinfo");return null!=r&&r.userId||console.error("quick platform warn:root App not logged in yet"),e(r||{})}},x=S((function(e){return e.rightList||[]})),A=S((function(e){return e.statffInfo||{}})),R=S((function(e){return e.staffInfo||{}})),j=S((function(e){return e.storeInfo||{}})),z=S((function(e){return e.storeLicenceInfo||{}})),L=function(e){return x().includes(e)},T=function(){var e=process.env.OEM_NAME,t=e?"zh-CN":"en-US";return{oem:e,env:process.env.REACT_APP_ENVKEY,lang:y("qs_lang")||t,token:sessionStorage.getItem("quick-token")||"",requestTokenKey:"quick-token",storeId:sessionStorage.getItem("quick-im-storeId")||""}},M=function(){var e;return null==(e=window.QUICK_CEP)||null==(e=e.oem)?void 0:e.name},N=function(e){return function(){return e(z())}},U={isPLG:N(b),isSLG:N(k),isEnterprise:N(E),isFree:N(C),isProfessional:N(I),isCredits:N(q),getLicense:z,isOEM:function(){return!!M()}},O={__proto__:null,login:P,getUserInfo:A,getStaffInfo:R,getStoreInfo:j,getStoreLicense:z,hasAuth:L,getSystem:T,getOEMName:M,License:U},F="https://quick-multilingual.obs.ap-southeast-3.myhuaweicloud.com",G={"zh-CN":"zh","en-US":"en",ko:"ko",ja:"ja","zh-TW":"zh-tw"},$=function(e,t){return void 0===t&&(t={}),e.replace(/\{[a-zA-Z_0-9]*\}/g,(function(e){return t[e.slice(1,-1)]}))},D=function(e,t){var n=function(e,t){var n={},r=T();return{messages:n,setup:function(){var o=d?r.lang:window.localStorage.getItem("quick_local_debug_lang")||r.lang;return function(e,t,n){var r;return r=function(e,t,n){return"prod"===e?F+"/"+t+"/"+G[n]+".json":F+"/"+t+"/"+e+"/"+G[n]+".json"}("dev"===e?"dev":"prod"===e?"prod":"test",t,n),fetch(r+"?t="+Date.now()).then((function(e){return e.json()})).catch((function(){return{}}))}(t||"prod",e,o).then((function(e){Object.assign(n,e)}))},i18n:function(e,t){var r=n[e];return void 0===r?e:t?r.replace(/\{[a-zA-Z_0-9]*\}/g,(function(e){return t[e.slice(1,-1)]})):r}}}(e,t);return{$i18n:n.i18n,$$i18n:$,messages:n.messages,loadPromise:(0,n.setup)()}},B={trigger:function(e,t){var n;null==(n=_())||n.trigger(e,t)},broadcast:function(e,t){var n;null==(n=_())||n.broadcast(e,t)},on:function(e,t){var n;null==(n=_())||n.on(e,t)},off:function(e,t){var n;null==(n=_())||n.off(e,t)}},W=["auth"],K=["post"],Q=["post"],Z=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var i=u.useState(),a=i[0],c=i[1],s=u.useState(!0),l=s[0],f=s[1],d=function(){return f(!0),e.apply(void 0,[t].concat(r)).then((function(e){c(e)})).finally((function(){f(!1)}))};return u.useEffect((function(){d()}),[]),{data:a,loading:l,request:d,setData:c}},H=c.createElement("div",{style:{width:"100%",height:"100&",textAlign:"center",fontSize:40}},["微应用本地调试模式初始化中..."]),V=function(e){return document.getElementById(e).value},Y=function(e){return c.createElement("div",{style:{fontSize:20,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",height:"100%"}},[c.createElement("div",{}),["请先登录:",c.createElement("table",{},[c.createElement("tr",{},[c.createElement("td",{},["帐号:",c.createElement("input",{id:"local_debug_account",style:{fontSize:20,width:400}})])]),c.createElement("tr",{},[c.createElement("td",{},["密码:",c.createElement("input",{id:"local_debug_password",type:"password",style:{fontSize:20,width:400}})])]),c.createElement("tr",{},[c.createElement("td",{colSpan:2},[c.createElement("button",{style:{fontSize:20,width:"100%"},onClickCapture:function(){e.onLogin({email:V("local_debug_account"),loginStatus:2,password:V("local_debug_password")})}},["登录"])])])])]])},J=function(e){var t=e.post,n=o._objectWithoutPropertiesLoose(e,K),r=j(),i=R(),a=window.localStorage.getItem("quick_local_debug_lang")||"zh-CN",u=Z(t,"/store/store/list").data;return c.createElement("div",{style:{position:"fixed",right:10,bottom:10,zIndex:1e4}},["quick-platform子应用调试工具:",c.createElement("div",{key:"store"},[c.createElement("span",{style:{float:"left"}},["当前店铺:"]),c.createElement("select",{style:{fontSize:16},value:r.id,onChange:function(e){t("/store/store/switch",{storeId:e.target.value}).then((function(e){sessionStorage.setItem("quick-storeId",e.storeId),sessionStorage.setItem("quick-token",e.jwt),sessionStorage.removeItem("quick-qyWechat"),console.log("%c [ halvee>]-133","font-size:13px; background:pink; color:#bf2c9f;",e.jwt),window.location.reload()})).catch((function(){alert("切换店铺失败")}))}},(u||[]).map((function(e){return c.createElement("option",{value:e.id,key:e.id},[e.storeName])})))]),c.createElement("div",{},[c.createElement("span",{style:{float:"left"}},["当前语言:"]),c.createElement("select",{style:{fontSize:16},value:a,onChange:function(e){localStorage.setItem("quick_local_debug_lang",e.target.value),window.location.reload()}},["zh-CN","en-US","ko","ja","zh-TW"].map((function(e){return c.createElement("option",{value:e,key:e},[e])})))]),c.createElement("div",{key:"user"},["当前用户:"+i.email]),c.createElement("button",{onClick:function(){sessionStorage.clear(),n.onLogout()}},["退出登录"])])},X=s.createFromIconfontCN({scriptUrl:document.getElementById("_CD_ICON_1633")?"":"https://front-assets.obs.ap-southeast-3.myhuaweicloud.com/library/icon/icon.js"}),ee=c.createContext({data:null}),te=function(e,t){return new Promise((function(n,r){var o=new window.Image;o.src=URL.createObjectURL(t),o.onload=n.bind(null,o.src),o.onerror=r.bind(null,e)}))},ne=function(e){return function(t){return e(t).then(te.bind(null,t)).catch((function(){return Promise.reject(t)}))}},re=ne((function(e){return fetch(e,{headers:{},mode:"cors"}).then((function(e){return e.blob()})).then((function(e){return l({blob:e})})).then((function(e){return Array.isArray(e)?e[0]:e}))})),oe=new Map,ie=function(e,t){if(oe.has(e))return oe.get(e);var n=t(e);return oe.set(e,n),n.finally((function(){oe.delete(e)})),n},ae=f.CancelToken,ue=function(e,t){return void 0===t&&(t={}),function(n,r){return void 0===r&&(r={}),function(o,i){return void 0===i&&(i={}),e(n,o||{},Object.assign({},t,r,i))}}},ce={__proto__:null,isMicroApp:d,tryImageTranscode:function(e,t){if(!t)return ie(e,(function(){return re(e)}));var n=ne(t);return ie(e,(function(){return re(e).catch(n)}))},buildHttpCtrl:function(e){var t,n=[],r=function(e){var t=f.create({baseURL:e}),n=t.interceptors.response.use.bind(t.interceptors.response),r=t.interceptors.request.use.bind(t.interceptors.request);return{instance:t,useRequestInterCeptor:r,useResponseInterCeptor:n}}(e),i=r.useRequestInterCeptor,a=r.useResponseInterCeptor,u=(t=n,function(e){for(;t.length;)t.shift().cancel(e)}),c=function(e,t){return["get","post"].map((function(n){return function(r,i,a){var u,c=(null==a?void 0:a.cancelTokenSource)||ae.source();null==a||delete a.cancelTokenSource;var s=((u={})["get"===n?"params":"data"]=i,u);t.push(c);var l=r.replace(/\{([a-zA-Z]+)\}/g,(function(e,t){if(!i)return t;var n=i[t]||t;return i.saveQuery?(console.log("params",i),delete i.saveQuery):delete i[t],n}));return e.request(o._extends({url:l,method:n.toUpperCase(),cancelToken:c.token},s,a||{})).then((function(e){return null==e?void 0:e.data})).then((function(e){return e.success?e.data:Promise.reject(e)}))}}))}(r.instance,n),s=c[0],l=c[1];return{abort:u,get:s,post:l,cancelCreator:function(e){return function(){for(var t=ae.source(),n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var i="string"==typeof r[0]?2:1;return r[i]=Object.assign({},r[i]||{},{cancelTokenSource:t}),[e.apply(void 0,r),function(e){t.cancel(e)}]}},getCreator:ue(s),postCreator:ue(l),useRequestInterCeptor:i,useResponseInterCeptor:a}},installI18n:D},se=c.createContext({colorPrimary:o.PrimaryColor,setPrimaryColor:function(e){}});window.__quick_platform_get_current_app__=_,exports.Theme=o.index,exports.App=function(e){var t,n=_(),r=u.useState(null==(t=n.parent)?void 0:t.cache(n.name+"-data")),o=r[0],i=r[1];u.useEffect((function(){var e=function(e){i(e)};return B.on(n.name+"-data-change",e),function(){B.off(n.name+"-data-change",e)}}),[n.name]);var a=u.useMemo((function(){return{data:o}}),[o]);return c.createElement(ee.Provider,{value:a},[e.children])},exports.AppEvent=B,exports.Authentication=O,exports.I18nFC=function(e,t){if(!t)return e;var n=[],r=0;return e.replace(/\{[a-zA-Z_0-9]*\}/g,(function(o,i){var a=e.slice(r,i);return n.push(a),n.push(t[o.slice(1,-1)]),r=i+o.length,""})),n.push(e.slice(r,e.length)),c.createElement(c.Fragment,{},n)},exports.IconFont=X,exports.LocalDebug=function(e){var t=e.post,n=o._objectWithoutPropertiesLoose(e,Q),r=Z(t,"/store/user/getUserInfo"),i=r.data,a=r.setData;return r.loading?H:i?(sessionStorage.setItem("quick-token",i.jwt),P(i),c.createElement(c.Fragment,{},n.hideInfo?n.children:[c.createElement(J,{key:"info-wrapper",post:t,onLogout:function(){a(null)}}),n.children])):c.createElement(Y,{onLogin:function(e){t("/store/user/login",e).then((function(e){P(e),a(e)})).catch((function(e){alert(e.data.message||"登录失败")}))}})},exports.MicroApp=function(e){var t=u.useRef(),n=u.useState(!0),r=n[0],o=n[1];return u.useEffect((function(){return function(){t.current&&(console.log(e.name,"应用卸载"),t.current.unmount(),console.log(e.name,"应用卸载完成"))}}),[]),u.useState((function(){e.data&&_().cache(e.name+"-data",e.data)})),u.useEffect((function(){e.data&&(_().cache(e.name+"-data",e.data),B.broadcast(e.name+"-data-change",e.data))}),[e.data,e.name]),c.createElement("div",{style:{width:"100%",height:"100%",position:"relative"}},[c.createElement("div",{style:{width:"100%",height:"100%"},className:e.className,ref:function(n){if(n&&!t.current){var r=T();t.current=function(e,t,n){var r=n||{},o=r.host,a=r.base,u=i.loadMicroApp({name:e,entry:(void 0===o?"":o)||window.location.origin+"/micro/"+e+"/"+((null==n?void 0:n.entry)||"micro")+".html",container:t,props:{base:void 0===a?"":a,name:e}});return u.mountPromise.catch((function(e){console.log("----启动子应用失败",e)})),u}(e.name,n,Object.assign({},e.extra,p("base",e.base),p("host",e.host),p("env",e.env||r.env),p("entry",e.entry))),t.current.mountPromise.then((function(){o(!1),null==e.onMounted||e.onMounted()}))}}}),r?c.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",top:0,left:0}},[e.loading]):null])},exports.Permission=function(e){var t=e.auth,n=void 0===t?function(){return!0}:t,r=o._objectWithoutPropertiesLoose(e,W);return L(r.code)&&n()?r.children:null},exports.ThemeHOC=function(e){return function(e){return function(t){var n=u.useState(o.PrimaryColor),r=n[1];return c.createElement(se.Provider,{key:"theme-hoc",value:{colorPrimary:n[0],setPrimaryColor:function(e){r(e)}}},[c.createElement(e,o._extends({},t,{key:"theme-hoc-component"}))])}}(e)},exports.Utils=ce,exports.getCurrentApp=_,exports.registerApp=function(e){v(e.name);var n=e.i18n?function(){var t=D(e.name,e.env);return!1!==e.i18n.global&&(window.$$i18n=t.$$i18n,window.$i18n=t.$i18n),Promise.all([t.loadPromise,null==e.i18n.onReady?void 0:e.i18n.onReady(t)])}:function(){return Promise.resolve()};return{beforeMount:function(){return o._asyncToGenerator(o._regeneratorRuntime().mark((function e(){return o._regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(){})));case 1:case"end":return e.stop()}}),e)})))()},mount:function(t){return o._asyncToGenerator(o._regeneratorRuntime().mark((function n(){return o._regeneratorRuntime().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return v(e.name),n.abrupt("return",null==e.lifecycles.mount?void 0:e.lifecycles.mount(t));case 2:case"end":return n.stop()}}),n)})))()},unmount:function(n){return o._asyncToGenerator(o._regeneratorRuntime().mark((function r(){return o._regeneratorRuntime().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return t&&(t.destroy(),t=void 0),r.abrupt("return",null==e.lifecycles.unmount?void 0:e.lifecycles.unmount(n));case 2:case"end":return r.stop()}}),r)})))()},bootstrap:function(t){return o._asyncToGenerator(o._regeneratorRuntime().mark((function r(){return o._regeneratorRuntime().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,n();case 2:return d&&t.base&&(console.log("来自主应用的路由base控制:",t.base),window.quick_qiankun_router_base=t.base),r.abrupt("return",null==e.lifecycles.bootstrap?void 0:e.lifecycles.bootstrap(t));case 4:case"end":return r.stop()}}),r)})))()}}},exports.useAppData=function(){return c.useContext(ee).data},exports.useThemePrimaryColor=function(){var e=u.useContext(se);return{color:e.colorPrimary,set:function(t){e.setPrimaryColor(t),o.updateBrandColor(t),document.documentElement.style.setProperty(o.generateVar("primary"),o.PrimaryColor)}}};
|
|
2
|
-
|
|
1
|
+
|
|
2
|
+
'use strict'
|
|
3
|
+
|
|
4
|
+
if (process.env.NODE_ENV === 'production') {
|
|
5
|
+
module.exports = require('./quick-platform.cjs.production.min.js')
|
|
6
|
+
} else {
|
|
7
|
+
module.exports = require('./quick-platform.cjs.development.js')
|
|
8
|
+
}
|