zy-react-library 1.0.84 → 1.0.86

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.
@@ -63,7 +63,7 @@ function HiddenLevelSelectTree(props) {
63
63
  }, []);
64
64
 
65
65
  return (
66
- <BasicSelectTree treeData={treeData} placeholder="隐患级别" nameKey="dictLabel" idKey="dictValue" {...restProps} />
66
+ <BasicSelectTree treeData={treeData} placeholder="隐患级别" onlyLastLevel={true} nameKey="dictLabel" idKey="dictValue" {...restProps} />
67
67
  );
68
68
  }
69
69
 
@@ -7,12 +7,7 @@ interface UseDownloadBlobOptions {
7
7
  params?: Record<string, any>;
8
8
  }
9
9
 
10
- export interface downloadBlobOptions {
11
- url: string;
12
- options?: UseDownloadBlobOptions;
13
- }
14
-
15
- export type DownloadBlobFunction = (options: downloadBlobOptions) => Promise<any>;
10
+ export type DownloadBlobFunction = (url: string, options: UseDownloadBlobOptions) => Promise<any>;
16
11
 
17
12
  /**
18
13
  * 下载Blob流文件
@@ -18,7 +18,7 @@ export default function useDownloadBlob(returnType = "object") {
18
18
  return reject(new Error("请传入 url"));
19
19
 
20
20
  const { name = "", type = "", params = {} } = options;
21
- const finalUrl = (process.env.app.API_HOST || window.__JJB_ENVIRONMENT__.API_HOST) + url;
21
+ const finalUrl = new URL((process.env.app.API_HOST || window.__JJB_ENVIRONMENT__.API_HOST) + url);
22
22
  Object.entries(params).forEach(([key, value]) => {
23
23
  finalUrl.searchParams.append(key, value);
24
24
  });
@@ -27,6 +27,7 @@ export default function useDownloadBlob(returnType = "object") {
27
27
  mode: "cors",
28
28
  headers: {
29
29
  "Content-Type": "application/json",
30
+ "token": window.sessionStorage["token"],
30
31
  },
31
32
  })
32
33
  .then((response) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zy-react-library",
3
3
  "private": false,
4
- "version": "1.0.84",
4
+ "version": "1.0.86",
5
5
  "type": "module",
6
6
  "description": "",
7
7
  "author": "LiuJiaNan",