@yuntower/yuntower-account-web-sdk 0.0.15 → 0.0.16
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 +3 -3
- package/dist/index.js +6 -10
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -32,11 +32,11 @@ declare class YunTowerAccountSDK {
|
|
|
32
32
|
private setupMessageListener;
|
|
33
33
|
/**
|
|
34
34
|
* 弹窗授权模式
|
|
35
|
-
* @param
|
|
36
|
-
* @param callback
|
|
35
|
+
* @param options 可选配置,如 { autoCloseOnFinish: false } 关闭成功/失败时自动关窗
|
|
36
|
+
* @param callback 授权回调
|
|
37
37
|
* @returns 返回 { close },由接入方在需要时调用 close() 关闭授权窗口
|
|
38
38
|
*/
|
|
39
|
-
window(
|
|
39
|
+
window(options?: WindowOptions, callback?: (response: CallbackResponse) => void): WindowController;
|
|
40
40
|
/**
|
|
41
41
|
* 重定向授权模式
|
|
42
42
|
* @param redirectUrl 授权完成后的重定向URL
|
package/dist/index.js
CHANGED
|
@@ -108,18 +108,14 @@ class YunTowerAccountSDK {
|
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
110
110
|
* 弹窗授权模式
|
|
111
|
-
* @param
|
|
112
|
-
* @param callback
|
|
111
|
+
* @param options 可选配置,如 { autoCloseOnFinish: false } 关闭成功/失败时自动关窗
|
|
112
|
+
* @param callback 授权回调
|
|
113
113
|
* @returns 返回 { close },由接入方在需要时调用 close() 关闭授权窗口
|
|
114
114
|
*/
|
|
115
|
-
window(
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const userCallback = typeof optionsOrCallback === "function"
|
|
120
|
-
? optionsOrCallback
|
|
121
|
-
: callback ?? (() => { });
|
|
122
|
-
const autoCloseOnFinish = options.autoCloseOnFinish !== false;
|
|
115
|
+
window(options, callback) {
|
|
116
|
+
const opts = options ?? {};
|
|
117
|
+
const userCallback = callback ?? (() => { });
|
|
118
|
+
const autoCloseOnFinish = opts?.autoCloseOnFinish !== false;
|
|
123
119
|
const authUrl = this.buildAuthUrl("window");
|
|
124
120
|
const authWindow = window.open(authUrl, "_blank", "width=500,height=600");
|
|
125
121
|
if (!authWindow) {
|