hzerojs-plugin-yqcloud-jssdk 1.0.9 → 1.0.10

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.
Files changed (2) hide show
  1. package/lib/index.js +5 -0
  2. 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(() => {
@@ -90,6 +91,9 @@ var src_default = (props) => {
90
91
  url
91
92
  );
92
93
  xhr.setRequestHeader("Accept", "application/json, text/plain, */*");
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 = jsonData.tenantId;
104
109
  setAppConfig(appConfig2);
105
110
  console.log("【YQCloud】解析配置成功:", appConfig2);
106
111
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hzerojs-plugin-yqcloud-jssdk",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "main": "lib/index.js",
5
5
  "license": "MIT",
6
6
  "scripts": {