ztxkutils 10.0.14 → 10.0.15
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/fileOperation.d.ts +19 -0
- package/dist/fileOperation.js +28 -1
- package/dist/hooks.js +2 -0
- package/dist/useFileIdToBase64.js +2 -0
- package/package.json +1 -1
package/dist/fileOperation.d.ts
CHANGED
|
@@ -73,4 +73,23 @@ export declare function createOriginalUrl(fileUrl: string, fileId: string, other
|
|
|
73
73
|
* @param {string} scale 缩略倍数
|
|
74
74
|
*/
|
|
75
75
|
export declare function createThumbnailUrl(apiUrl: string, fileId: string, scale: number, otherOption?: any): string;
|
|
76
|
+
/**
|
|
77
|
+
* 附件预览的文件id加密
|
|
78
|
+
* @param fileId
|
|
79
|
+
* @returns
|
|
80
|
+
*/
|
|
81
|
+
export declare function encodeFileIdByPreview(fileId: string): string;
|
|
82
|
+
/**
|
|
83
|
+
* 附件预览的文件id加密
|
|
84
|
+
* @param fileId
|
|
85
|
+
* @returns
|
|
86
|
+
*/
|
|
87
|
+
export declare function encodeFileIdByDownload(fileId: string): string;
|
|
88
|
+
/**
|
|
89
|
+
* 附件预览的文件id加密。加密后只encode一次
|
|
90
|
+
* 用在那些通过body传参的业务里
|
|
91
|
+
* @param fileId
|
|
92
|
+
* @returns
|
|
93
|
+
*/
|
|
94
|
+
export declare function encodeOneFileIdByDownload(fileId: string): string;
|
|
76
95
|
export {};
|
package/dist/fileOperation.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { g as getToken } from './authority-7a91cb9f.js';
|
|
2
2
|
import { d as dangerouslySetXss } from './tools-390e3466.js';
|
|
3
|
+
import { a as crypto } from './crypto-c481f616.js';
|
|
3
4
|
import './tslib.es6-35653116.js';
|
|
4
5
|
import 'dayjs';
|
|
6
|
+
import 'crypto';
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* @author cyx
|
|
@@ -298,6 +300,31 @@ function createThumbnailUrl(apiUrl, fileId, scale, otherOption) {
|
|
|
298
300
|
: apiUrl;
|
|
299
301
|
var token = getToken() || (otherOption === null || otherOption === void 0 ? void 0 : otherOption.authTOken);
|
|
300
302
|
return _apiUrl + "/api/zmdms-resource/oss/endpoint/thumbnail/" + fileId + "?scale=" + scale + "&Zmdms-Auth=bearer " + token;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* 附件预览的文件id加密
|
|
306
|
+
* @param fileId
|
|
307
|
+
* @returns
|
|
308
|
+
*/
|
|
309
|
+
function encodeFileIdByPreview(fileId) {
|
|
310
|
+
return encodeURIComponent(crypto.encrypt(fileId));
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* 附件预览的文件id加密
|
|
314
|
+
* @param fileId
|
|
315
|
+
* @returns
|
|
316
|
+
*/
|
|
317
|
+
function encodeFileIdByDownload(fileId) {
|
|
318
|
+
return encodeURIComponent(encodeURIComponent(crypto.encrypt(fileId)));
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* 附件预览的文件id加密。加密后只encode一次
|
|
322
|
+
* 用在那些通过body传参的业务里
|
|
323
|
+
* @param fileId
|
|
324
|
+
* @returns
|
|
325
|
+
*/
|
|
326
|
+
function encodeOneFileIdByDownload(fileId) {
|
|
327
|
+
return encodeURIComponent(crypto.encrypt(fileId));
|
|
301
328
|
}
|
|
302
329
|
|
|
303
|
-
export { batchDownloadFileCallBack, batchPreviewFile, createDownloadUrl, createDownloadUrlNoBase, createOriginalUrl, createPublicDownloadUrl, createThumbnailUrl, downloadFile, downloadFileCallBack, downloadPublicFile, previewFile };
|
|
330
|
+
export { batchDownloadFileCallBack, batchPreviewFile, createDownloadUrl, createDownloadUrlNoBase, createOriginalUrl, createPublicDownloadUrl, createThumbnailUrl, downloadFile, downloadFileCallBack, downloadPublicFile, encodeFileIdByDownload, encodeFileIdByPreview, encodeOneFileIdByDownload, previewFile };
|
package/dist/hooks.js
CHANGED
|
@@ -7,6 +7,8 @@ import './fileOperation.js';
|
|
|
7
7
|
import './authority-7a91cb9f.js';
|
|
8
8
|
import './tools-390e3466.js';
|
|
9
9
|
import 'dayjs';
|
|
10
|
+
import './crypto-c481f616.js';
|
|
11
|
+
import 'crypto';
|
|
10
12
|
|
|
11
13
|
function useTableLinkage(_a) {
|
|
12
14
|
var records = _a.records, callbackPromise = _a.callbackPromise, dependencies = _a.dependencies, devDependencies = _a.devDependencies;
|