@gup-fe/js-sdk 2.1.1 → 2.1.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/dist/index.d.ts +2 -1
- package/dist/js-sdk.js +28 -23
- package/dist/js-sdk.umd.js +2 -2
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -47,8 +47,9 @@ declare interface ConfigProviderProps {
|
|
|
47
47
|
|
|
48
48
|
export declare function Login({ open, onOpenChange, sceneId, onPhoneLoginSuccess, onAccountLoginSuccess, onUidLoginSuccess, onLoginSuccess, onLoginError, closeable, mountToaster, toastConfigs, ...props }: Props): JSX.Element;
|
|
49
49
|
|
|
50
|
-
export declare function login({ loginTypes, gameId, onLoginSuccess, onLoginError, }: {
|
|
50
|
+
export declare function login({ loginTypes, defaultLoginType, gameId, onLoginSuccess, onLoginError, }: {
|
|
51
51
|
loginTypes?: LoginTypes[];
|
|
52
|
+
defaultLoginType?: LoginTypes;
|
|
52
53
|
gameId: string;
|
|
53
54
|
onLoginSuccess?: (data: any) => void;
|
|
54
55
|
onLoginError?: (error: any) => void;
|
package/dist/js-sdk.js
CHANGED
|
@@ -11996,7 +11996,9 @@ const Wn = new cS({
|
|
|
11996
11996
|
},
|
|
11997
11997
|
async responseInterceptor(e, t) {
|
|
11998
11998
|
if ([
|
|
11999
|
-
"/passport-api/v2/ztgame/auth/login"
|
|
11999
|
+
"/passport-api/v2/ztgame/auth/login",
|
|
12000
|
+
"/passport-api/v2/sms-captchas",
|
|
12001
|
+
"/passport-api/v2/ztgame/auth/mobile-register"
|
|
12000
12002
|
].some((r) => t.url.includes(r)))
|
|
12001
12003
|
return e;
|
|
12002
12004
|
if (e?.code !== 0)
|
|
@@ -25787,49 +25789,52 @@ function Bf({
|
|
|
25787
25789
|
}
|
|
25788
25790
|
function lI({
|
|
25789
25791
|
loginTypes: e,
|
|
25790
|
-
|
|
25791
|
-
|
|
25792
|
-
|
|
25792
|
+
defaultLoginType: t,
|
|
25793
|
+
gameId: n,
|
|
25794
|
+
onLoginSuccess: r,
|
|
25795
|
+
onLoginError: o
|
|
25793
25796
|
}) {
|
|
25794
25797
|
if (document.querySelector(".login-sdk-container"))
|
|
25795
25798
|
return console.warn("Login component is already active. Multiple instances are not allowed."), { close: () => {
|
|
25796
25799
|
} };
|
|
25797
|
-
const
|
|
25798
|
-
|
|
25799
|
-
const
|
|
25800
|
+
const s = document.createElement("div");
|
|
25801
|
+
s.className = "login-sdk-container", document.body.appendChild(s);
|
|
25802
|
+
const i = jv.createRoot(s), a = () => {
|
|
25800
25803
|
setTimeout(() => {
|
|
25801
|
-
|
|
25804
|
+
i.unmount(), s.remove();
|
|
25802
25805
|
}, 200);
|
|
25803
|
-
},
|
|
25804
|
-
|
|
25806
|
+
}, l = () => {
|
|
25807
|
+
i.render(
|
|
25805
25808
|
/* @__PURE__ */ A(
|
|
25806
25809
|
Bf,
|
|
25807
25810
|
{
|
|
25808
|
-
gameId:
|
|
25811
|
+
gameId: n,
|
|
25809
25812
|
loginTypes: e,
|
|
25813
|
+
defaultLoginType: t,
|
|
25810
25814
|
open: !1,
|
|
25811
|
-
onOpenChange:
|
|
25812
|
-
onLoginSuccess:
|
|
25813
|
-
onLoginError:
|
|
25815
|
+
onOpenChange: c,
|
|
25816
|
+
onLoginSuccess: r,
|
|
25817
|
+
onLoginError: o
|
|
25814
25818
|
}
|
|
25815
25819
|
)
|
|
25816
|
-
),
|
|
25817
|
-
},
|
|
25818
|
-
|
|
25820
|
+
), a();
|
|
25821
|
+
}, c = (u) => {
|
|
25822
|
+
u || l();
|
|
25819
25823
|
};
|
|
25820
|
-
return
|
|
25824
|
+
return i.render(
|
|
25821
25825
|
/* @__PURE__ */ A(
|
|
25822
25826
|
Bf,
|
|
25823
25827
|
{
|
|
25824
|
-
gameId:
|
|
25828
|
+
gameId: n,
|
|
25825
25829
|
loginTypes: e,
|
|
25830
|
+
defaultLoginType: t,
|
|
25826
25831
|
open: !0,
|
|
25827
|
-
onOpenChange:
|
|
25828
|
-
onLoginSuccess:
|
|
25829
|
-
onLoginError:
|
|
25832
|
+
onOpenChange: c,
|
|
25833
|
+
onLoginSuccess: r,
|
|
25834
|
+
onLoginError: o
|
|
25830
25835
|
}
|
|
25831
25836
|
)
|
|
25832
|
-
), { close:
|
|
25837
|
+
), { close: l };
|
|
25833
25838
|
}
|
|
25834
25839
|
const bI = {
|
|
25835
25840
|
login: lI
|