@ts-max/portal 0.0.3 → 0.0.5

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/index.cjs CHANGED
@@ -38,4 +38,4 @@
38
38
  width: 450px;
39
39
  height: 500px;
40
40
  border-radius: 10px;
41
- `},Ar=[{value:"test",label:"测试环境",url:"https://global-portal-test.suixingpay.com/login?enabledWorkWeChatLogin=false"},{value:"dev",label:"开发环境",url:"https://global-portal-dev.cogolinks.com/login?enabledWorkWeChatLogin=false"}];function Yt(r){let{onLogin:t,title:A}=r;const M=`${A}-login-env`,[s,y]=q.useState("dev");q.useEffect(()=>{const e=window.localStorage.getItem(M)||"dev";y(e)},[]),q.useEffect(()=>{window.localStorage.setItem(M,s)},[s]);const n=(Ar.find(e=>e.value===s)||Ar[0]).url;return q.useEffect(()=>{window.addEventListener("message",e=>{if(e.data.type==="PORTAL_LOGIN"){const W=e.data.data;t?.(W)}})},[t]),S.jsxs("div",{className:g.root,children:[S.jsxs("div",{className:g.top,children:[S.jsxs("h1",{className:g.title,children:[A," - 跨境运营平台快捷登录"]}),S.jsx("div",{className:g.envRadio,children:Ar.map(e=>S.jsxs("label",{children:[S.jsx("input",{type:"radio",name:"env",value:e.value,checked:s===e.value,onChange:()=>y(e.value)}),e.label]},e.value))})]}),S.jsx("iframe",{className:g.iframe,title:"统一门户登录",src:n})]})}exports.GlobalPortalLogin=Yt;
41
+ `},Ar=[{value:"test",label:"测试环境",url:"https://global-portal-test.suixingpay.com/login?enabledWorkWeChatLogin=false"},{value:"dev",label:"开发环境",url:"https://global-portal-dev.cogolinks.com/login?enabledWorkWeChatLogin=false"}];function Yt(r){let{onLogin:t,title:A}=r;const M=`${A}-login-env`,[s,y]=q.useState();q.useEffect(()=>{const e=window.localStorage.getItem(M)||"dev";y(e)},[]),q.useEffect(()=>{s&&window.localStorage.setItem(M,s)},[s]);const n=(Ar.find(e=>e.value===s)||Ar[0]).url;return q.useEffect(()=>{window.addEventListener("message",e=>{if(e.data.type==="PORTAL_LOGIN"){const W=e.data.data;t?.(W)}})},[t]),S.jsxs("div",{className:g.root,children:[S.jsxs("div",{className:g.top,children:[S.jsxs("h1",{className:g.title,children:[A," - Global运营平台快捷登录"]}),S.jsx("div",{className:g.envRadio,children:Ar.map(e=>S.jsxs("label",{children:[S.jsx("input",{type:"radio",name:"env",value:e.value,checked:s===e.value,onChange:()=>y(e.value)}),e.label]},e.value))})]}),S.jsx("iframe",{className:g.iframe,title:"Global统一门户登录",src:n})]})}exports.GlobalPortalLogin=Yt;
package/dist/index.mjs CHANGED
@@ -970,12 +970,12 @@ const xt = "data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEd
970
970
  ];
971
971
  function ct(r) {
972
972
  let { onLogin: t, title: A } = r;
973
- const M = `${A}-login-env`, [s, y] = Dr("dev");
973
+ const M = `${A}-login-env`, [s, y] = Dr();
974
974
  rr(() => {
975
975
  const e = window.localStorage.getItem(M) || "dev";
976
976
  y(e);
977
977
  }, []), rr(() => {
978
- window.localStorage.setItem(M, s);
978
+ s && window.localStorage.setItem(M, s);
979
979
  }, [s]);
980
980
  const n = (Mr.find((e) => e.value === s) || Mr[0]).url;
981
981
  return rr(() => {
@@ -989,7 +989,7 @@ function ct(r) {
989
989
  /* @__PURE__ */ K("div", { className: B.top, children: [
990
990
  /* @__PURE__ */ K("h1", { className: B.title, children: [
991
991
  A,
992
- " - 跨境运营平台快捷登录"
992
+ " - Global运营平台快捷登录"
993
993
  ] }),
994
994
  /* @__PURE__ */ _("div", { className: B.envRadio, children: Mr.map((e) => /* @__PURE__ */ K("label", { children: [
995
995
  /* @__PURE__ */ _(
@@ -1009,7 +1009,7 @@ function ct(r) {
1009
1009
  "iframe",
1010
1010
  {
1011
1011
  className: B.iframe,
1012
- title: "统一门户登录",
1012
+ title: "Global统一门户登录",
1013
1013
  src: n
1014
1014
  }
1015
1015
  )
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/login/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAC,SAAS,EAAsB,MAAM,OAAO,CAAC;AAG5D,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IAEd,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;CAC1C;AAeD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,oBAAoB,2CA+D5D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/login/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAC,SAAS,EAAsB,MAAM,OAAO,CAAC;AAG5D,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IAEd,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;CAC1C;AAeD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,oBAAoB,2CAgE5D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ts-max/portal",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "跨境运营平台工具库",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -35,5 +35,5 @@
35
35
  "login"
36
36
  ],
37
37
  "license": "MIT",
38
- "gitHead": "595ff341c12ecd65f49b5df5cbc6989e04dd5a75"
38
+ "gitHead": "687d55e50001016d51f15df94a7c95b630a9765a"
39
39
  }