hzerojs-plugin-yqcloud-jssdk 1.0.9 → 1.0.11
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 +6 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -44,6 +44,7 @@ var src_default = (props) => {
|
|
|
44
44
|
var _a, _b;
|
|
45
45
|
const { token, entryDetail, apiHost = YQ_API_HOST, tokenPath = "/iam/v1/zknow/encrypt/quick" } = props;
|
|
46
46
|
const eleRef = import_react.default.useRef(null);
|
|
47
|
+
const tenantIdRef = import_react.default.useRef(null);
|
|
47
48
|
const [appConfig, setAppConfig] = import_react.default.useState(false);
|
|
48
49
|
const [isVisible, setIsVisble] = import_react.default.useState(false);
|
|
49
50
|
import_react.default.useEffect(() => {
|
|
@@ -89,7 +90,10 @@ var src_default = (props) => {
|
|
|
89
90
|
method,
|
|
90
91
|
url
|
|
91
92
|
);
|
|
92
|
-
xhr.setRequestHeader("Accept", "application/json
|
|
93
|
+
xhr.setRequestHeader("Accept", "application/json");
|
|
94
|
+
if (tenantIdRef.current) {
|
|
95
|
+
xhr.setRequestHeader("x-tenant-id", tenantIdRef.current);
|
|
96
|
+
}
|
|
93
97
|
xhr.send(data);
|
|
94
98
|
});
|
|
95
99
|
}
|
|
@@ -101,6 +105,7 @@ var src_default = (props) => {
|
|
|
101
105
|
console.log("【YQCloud】:", jsonData.message);
|
|
102
106
|
} else {
|
|
103
107
|
const appConfig2 = JSON.parse(jsonData.jsonConfig);
|
|
108
|
+
tenantIdRef.current = appConfig2.tenantId;
|
|
104
109
|
setAppConfig(appConfig2);
|
|
105
110
|
console.log("【YQCloud】解析配置成功:", appConfig2);
|
|
106
111
|
}
|