hzerojs-plugin-yqcloud-jssdk 1.0.7 → 1.0.8
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/index.js +21 -15
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -73,24 +73,30 @@ var src_default = (props) => {
|
|
|
73
73
|
}, [isVisible]);
|
|
74
74
|
(0, import_react.useEffect)(() => {
|
|
75
75
|
const url = `${apiHost}/iam/yqc/open_apps/quick/${token}`;
|
|
76
|
-
(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
76
|
+
const xhr = new XMLHttpRequest();
|
|
77
|
+
xhr.withCredentials = false;
|
|
78
|
+
xhr.addEventListener("readystatechange", function() {
|
|
79
|
+
if (xhr.readyState === 4) {
|
|
80
|
+
const jsonData = JSON.parse(xhr.responseText);
|
|
81
|
+
try {
|
|
82
|
+
if (jsonData && jsonData.failed) {
|
|
83
|
+
console.log("【YQCloud】:", jsonData.message);
|
|
84
|
+
} else {
|
|
85
|
+
const appConfig2 = JSON.parse(jsonData.jsonConfig);
|
|
86
|
+
setAppConfig(appConfig2);
|
|
87
|
+
console.log("【YQCloud】解析配置成功:", appConfig2);
|
|
88
|
+
}
|
|
89
|
+
} catch (e) {
|
|
90
|
+
console.log("【YQCloud】解析配置失败:", e);
|
|
89
91
|
}
|
|
90
|
-
} catch (e) {
|
|
91
|
-
console.log("【YQCloud】解析配置失败:", e);
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
|
+
xhr.open(
|
|
95
|
+
"GET",
|
|
96
|
+
url
|
|
97
|
+
);
|
|
98
|
+
xhr.setRequestHeader("Accept", "application/json, text/plain, */*");
|
|
99
|
+
xhr.send();
|
|
94
100
|
}, [isVisible]);
|
|
95
101
|
const openModal = async (openFunction) => {
|
|
96
102
|
const secret = await import_axios.default.get(tokenPath || "/iam/v1/zknow/encrypt/quick");
|