@indfnd/utils 0.1.32 → 0.1.35

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/global.d.ts CHANGED
@@ -4,6 +4,7 @@ interface Window {
4
4
  NodeRSA: any
5
5
  Base64: any
6
6
  native: any
7
+ wx: any
7
8
  }
8
9
 
9
10
  interface Date {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indfnd/utils",
3
- "version": "0.1.32",
3
+ "version": "0.1.35",
4
4
  "author": "huxuetong",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -1,12 +1,21 @@
1
1
  import { axios } from '@/utils'
2
2
  import { config } from '@/config'
3
3
  import { getLocalStorage, setLocalStorage } from '@/utils/storage'
4
+ import { getUserInfoCache } from '@/utils/cache'
5
+ import { getGlobalConfig } from '@/api/platform/config.js'
4
6
 
5
7
  const UC_CONTEXT = config.ucExtServerContext
6
8
 
7
- const DATAVERSION_KEY = 'ind-cache-dataVersion-applicationTree'
8
-
9
+ // TODO 调用platform的getGlobalConfig,如果未开启前端缓存enableTreeLocalCache == '1',改为原始逻辑
9
10
  export async function getApplicationTreeApi(params) {
11
+ const DATAVERSION_KEY = 'ind-cache-dataVersion-applicationTree' + getUserInfoCache()?.manageUnitId
12
+ //0.读取全局配置,是否使用缓存
13
+ const globalConfigData = await getGlobalConfig()
14
+ if (!globalConfigData?.enableTreeLocalCache || globalConfigData?.enableTreeLocalCache !== '1') {
15
+ return axios.formPost(`${UC_CONTEXT}/tree/uc-application/getApplicationTree`, {
16
+ params,
17
+ })
18
+ }
10
19
  //1.读取缓存,获得版本号
11
20
  const cachedData = getLocalStorage(DATAVERSION_KEY)
12
21
 
@@ -0,0 +1,22 @@
1
+ // 使用原生的axios,避免拦截器报无会话
2
+ import axios from 'axios'
3
+ import { getSessionStorage, removeSessionStorage, setSessionStorage } from '@/utils/storage'
4
+
5
+ const GLOBAL_CACHE_KEY = 'global-cache'
6
+
7
+ /**
8
+ * 获取云庭配置的global配置文件,取到以后放到sessionStorage,避免重复请求
9
+ */
10
+ export const getGlobalConfig = async () => {
11
+ if (getSessionStorage(GLOBAL_CACHE_KEY)) {
12
+ return getSessionStorage(GLOBAL_CACHE_KEY)
13
+ } else {
14
+ // 加载global配置,当前只有系统配置,组件配置没在内
15
+ let url =
16
+ location.protocol + '//' + location.host + '/ibp-sc/manage/global?t=' + new Date().getTime()
17
+ return axios.get(url).then(({ data }) => {
18
+ setSessionStorage(GLOBAL_CACHE_KEY, data)
19
+ return data
20
+ })
21
+ }
22
+ }
@@ -2,3 +2,4 @@ export * from './dict'
2
2
  export * from './menu'
3
3
  export * from './oss'
4
4
  export * from './user'
5
+ export * from './config.js'
@@ -1,4 +1,4 @@
1
- import { CONTENT_TYPE, axios } from '@/utils'
1
+ import { CONTENT_TYPE, axios, getToken, MIME_TYPE } from '@/utils'
2
2
  import { config } from '@/config'
3
3
  import { AxiosRequestConfig, ResponseType } from 'axios'
4
4
 
@@ -72,3 +72,257 @@ export function getPreviewUrlApi(fileId: string) {
72
72
  axiosConfig,
73
73
  )
74
74
  }
75
+
76
+ /**
77
+ * 获取文档中心预览URL
78
+ *
79
+ * @param fileId 文件Id
80
+ * @param fileName 文件名
81
+ * @returns 文件内容
82
+ */
83
+ export async function downLoadScDcApi(fileId: string, fileName: string) {
84
+ const ua = navigator.userAgent
85
+ if (/miniProgram/i.test(ua)) {
86
+ window.wx.miniProgram.navigateTo({
87
+ url: `/pages/download/index?downloadFileId=${fileId}`,
88
+ })
89
+ } else {
90
+ const downloadUrl = `${
91
+ (location.pathname.includes('scyxweb') ? '/scyxgateway' : '') + '/ind-uc-ext-server'
92
+ }/oss/file/get/${fileId}`
93
+ const token = getToken() // 获取当前 Token
94
+
95
+ const response = await fetch(downloadUrl, {
96
+ headers: {
97
+ token: token + '',
98
+ },
99
+ })
100
+
101
+ if (!response.ok) {
102
+ throw new Error(`下载失败: ${response.status}`)
103
+ }
104
+
105
+ const blob = await response.blob()
106
+
107
+ if (!fileName) {
108
+ fileName = getFilenameFromResponse(response)
109
+ }
110
+
111
+ // 下载文件mime-type
112
+ let mimeType = 'application/octet-stream'
113
+ // 获取文件扩展名(支持多后缀如 .tar.gz)
114
+ const name = fileName?.toLowerCase()
115
+ const match = name.match(/\.([a-z0-9]+)$/)
116
+
117
+ const extension = match?.[1]
118
+
119
+ // 优先从映射表中获取
120
+ if (MIME_TYPE[extension]) {
121
+ mimeType = MIME_TYPE[extension]
122
+ }
123
+ const fileBlob = new Blob([blob], { type: mimeType })
124
+ const url = window.URL.createObjectURL(fileBlob)
125
+
126
+ const link = document.createElement('a')
127
+ link.href = url
128
+ link.download = fileName
129
+ link.style.display = 'none'
130
+ link.target = '_blank'
131
+
132
+ document.body.appendChild(link)
133
+ link.click()
134
+
135
+ // // 清理
136
+ document.body.removeChild(link)
137
+
138
+ // TODO不注释掉这行代码,iOS不能跳转下载,注释掉会有性能问题,也许是时机的问题
139
+ // window.URL.revokeObjectURL(url);
140
+ }
141
+ }
142
+
143
+ /**
144
+ * 解析 Content-Disposition 头,支持 RFC 5987 编码
145
+ * @param {string} contentDisposition - Content-Disposition 头值
146
+ * @returns {string|null} 解析出的文件名
147
+ */
148
+ function parseContentDisposition(contentDisposition) {
149
+ if (!contentDisposition) return null;
150
+
151
+ console.log('原始 Content-Disposition:', contentDisposition); // 调试用
152
+
153
+ // 1. 首先尝试解析 filename* (RFC 5987 格式)
154
+ // 格式: filename*=UTF-8''encoded-filename
155
+ const utf8FilenameMatch = contentDisposition.match(/filename\*=(?:UTF-8''|UTF-8\s*'')([^;]+)/i);
156
+
157
+ if (utf8FilenameMatch && utf8FilenameMatch[1]) {
158
+ try {
159
+ // 解码 RFC 5987 编码的文件名
160
+ const decoded = decodeURIComponent(utf8FilenameMatch[1].trim());
161
+ console.log('解析 RFC 5987 文件名:', decoded);
162
+ return decoded;
163
+ } catch (e) {
164
+ console.warn('RFC 5987 解码失败:', e);
165
+ // 继续尝试其他格式
166
+ }
167
+ }
168
+
169
+ // 2. 尝试解析 filename* 的其他编码格式
170
+ const filenameStarMatch = contentDisposition.match(/filename\*=([^;]+)/i);
171
+ if (filenameStarMatch && filenameStarMatch[1]) {
172
+ const encoded = filenameStarMatch[1].trim();
173
+
174
+ // 检查是否包含编码信息(如 ISO-8859-1, UTF-8 等)
175
+ if (encoded.includes("''")) {
176
+ const parts = encoded.split("''");
177
+ if (parts.length === 2) {
178
+ try {
179
+ const decoded = decodeURIComponent(parts[1]);
180
+ console.log('解析 filename* 文件名:', decoded);
181
+ return decoded;
182
+ } catch (e) {
183
+ console.warn('filename* 解码失败:', e);
184
+ }
185
+ }
186
+ }
187
+ }
188
+
189
+ // 3. 尝试解析普通的 filename(引号内的)
190
+ const quotedFilenameMatch = contentDisposition.match(/filename="([^"]+)"/i);
191
+ if (quotedFilenameMatch && quotedFilenameMatch[1]) {
192
+ console.log('解析引号内文件名:', quotedFilenameMatch[1]);
193
+ return quotedFilenameMatch[1];
194
+ }
195
+
196
+ // 4. 尝试解析不带引号的 filename
197
+ const unquotedFilenameMatch = contentDisposition.match(/filename=([^;]+)/i);
198
+ if (unquotedFilenameMatch && unquotedFilenameMatch[1]) {
199
+ const filename = unquotedFilenameMatch[1].trim();
200
+ console.log('解析无引号文件名:', filename);
201
+ return filename;
202
+ }
203
+
204
+ console.log('未找到有效的文件名');
205
+ return null;
206
+ }
207
+
208
+ /**
209
+ * 从响应中获取文件名
210
+ * @param {Response} response - fetch响应对象
211
+ * @returns {Promise<string>} 文件名
212
+ */
213
+ function getFilenameFromResponse(response) {
214
+ const contentDisposition = response.headers.get('Content-Disposition');
215
+ console.log('Content-Disposition 头:', contentDisposition);
216
+
217
+ let filename = null;
218
+
219
+ if (contentDisposition) {
220
+ filename = parseContentDisposition(contentDisposition);
221
+ console.log('解析到的文件名:', filename);
222
+ }
223
+
224
+ // 如果从 Content-Disposition 中没获取到,从 URL 获取
225
+ if (!filename && response.url) {
226
+ filename = extractFilenameFromUrl(response.url);
227
+ console.log('从 URL 提取的文件名:', filename);
228
+ }
229
+
230
+ // 如果还是没有,使用默认文件名
231
+ if (!filename) {
232
+ filename = 'download';
233
+ console.log('使用默认文件名:', filename);
234
+ }
235
+
236
+ // 确保文件名有扩展名
237
+ filename = ensureFileExtension(filename, response.headers.get('Content-Type'));
238
+
239
+ return filename;
240
+ }
241
+
242
+ /**
243
+ * 根据内容类型获取文件扩展名
244
+ */
245
+ function getExtensionFromContentType(contentType) {
246
+ if (!contentType) return '';
247
+
248
+ const contentTypeToExtension = {
249
+ // 图片
250
+ 'image/jpeg': '.jpg',
251
+ 'image/jpg': '.jpg',
252
+ 'image/png': '.png',
253
+ 'image/gif': '.gif',
254
+ 'image/webp': '.webp',
255
+ 'image/svg+xml': '.svg',
256
+ 'image/bmp': '.bmp',
257
+
258
+ // 文档
259
+ 'application/pdf': '.pdf',
260
+ 'application/msword': '.doc',
261
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': '.docx',
262
+ 'application/vnd.ms-excel': '.xls',
263
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': '.xlsx',
264
+ 'application/vnd.ms-powerpoint': '.ppt',
265
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation': '.pptx',
266
+
267
+ // 文本
268
+ 'text/plain': '.txt',
269
+ 'text/html': '.html',
270
+ 'text/css': '.css',
271
+ 'text/javascript': '.js',
272
+ 'application/json': '.json',
273
+ 'text/csv': '.csv',
274
+ 'text/xml': '.xml',
275
+
276
+ // 压缩文件
277
+ 'application/zip': '.zip',
278
+ 'application/x-rar-compressed': '.rar',
279
+ 'application/x-7z-compressed': '.7z',
280
+ 'application/gzip': '.gz',
281
+
282
+ // 其他
283
+ 'application/octet-stream': '.bin',
284
+ };
285
+
286
+ // 提取主类型(去除字符集等)
287
+ const mainType = contentType.split(';')[0].trim();
288
+ return contentTypeToExtension[mainType] || '';
289
+ }
290
+
291
+ /**
292
+ * 确保文件名有合适的扩展名
293
+ */
294
+ function ensureFileExtension(filename, contentType) {
295
+ // 如果文件名已经有扩展名,直接返回
296
+ if (filename.includes('.')) {
297
+ return filename;
298
+ }
299
+
300
+ // 根据 Content-Type 添加扩展名
301
+ const extension = getExtensionFromContentType(contentType);
302
+ if (extension) {
303
+ return filename + extension;
304
+ }
305
+
306
+ return filename;
307
+ }
308
+
309
+ /**
310
+ * 从 URL 提取文件名
311
+ */
312
+ function extractFilenameFromUrl(url) {
313
+ try {
314
+ const urlObj = new URL(url);
315
+ const pathname = urlObj.pathname;
316
+
317
+ // 获取路径的最后一部分
318
+ const lastSegment = pathname.split('/').pop();
319
+
320
+ // 移除查询参数和哈希
321
+ const filename = lastSegment.split('?')[0].split('#')[0];
322
+
323
+ return filename || null;
324
+ } catch (e) {
325
+ console.warn('从 URL 提取文件名失败:', e);
326
+ return null;
327
+ }
328
+ }
package/src/api/user.ts CHANGED
@@ -1,12 +1,19 @@
1
1
  import { axios } from '@/utils'
2
2
  import { config } from '@/config'
3
3
  import { getLocalStorage, setLocalStorage } from '@/utils/storage'
4
+ import { getUserInfoCache } from '@/utils/cache'
5
+ import { getGlobalConfig } from '@/api/platform/config.js'
4
6
 
5
7
  const UC_CONTEXT = config.ucExtServerContext
6
8
 
7
- const DATAVERSION_KEY = 'ind-cache-dataVersion-organTree'
8
-
9
9
  export async function listUserTreeApi(params) {
10
+ const DATAVERSION_KEY = 'ind-cache-dataVersion-organTree' + getUserInfoCache()?.manageUnitId
11
+
12
+ //0.读取全局配置,是否使用缓存
13
+ const globalConfigData = await getGlobalConfig()
14
+ if (!globalConfigData?.enableTreeLocalCache || globalConfigData?.enableTreeLocalCache !== '1') {
15
+ return axios.get(`${UC_CONTEXT}/tree/uc-user/listUserTree`, { params })
16
+ }
10
17
  //1.读取缓存,获得版本号
11
18
  const cachedData = getLocalStorage(DATAVERSION_KEY)
12
19
 
@@ -1,2 +1,2 @@
1
- export declare function listComTreeApi(params: any): Promise<import("axios").AxiosResponse<any, any>>;
1
+ export declare function listComTreeApi(params: any): Promise<import("axios").AxiosResponse<any>>;
2
2
  //# sourceMappingURL=com.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"com.d.ts","sourceRoot":"","sources":["../../src/api/com.ts"],"names":[],"mappings":"AAKA,wBAAgB,cAAc,CAAC,MAAM,KAAA,oDAKpC"}
1
+ {"version":3,"file":"com.d.ts","sourceRoot":"","sources":["../../src/api/com.ts"],"names":[],"mappings":"AAKA,wBAAgB,cAAc,CAAC,MAAM,KAAA,+CAKpC"}
@@ -1,2 +1,2 @@
1
- export declare function listIndexDescApi(params: any): Promise<import("axios").AxiosResponse<any, any>>;
1
+ export declare function listIndexDescApi(params: any): Promise<import("axios").AxiosResponse<any>>;
2
2
  //# sourceMappingURL=index-desc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-desc.d.ts","sourceRoot":"","sources":["../../src/api/index-desc.ts"],"names":[],"mappings":"AAKA,wBAAgB,gBAAgB,CAAC,MAAM,KAAA,oDAEtC"}
1
+ {"version":3,"file":"index-desc.d.ts","sourceRoot":"","sources":["../../src/api/index-desc.ts"],"names":[],"mappings":"AAKA,wBAAgB,gBAAgB,CAAC,MAAM,KAAA,+CAEtC"}
@@ -1,7 +1,7 @@
1
- export * from './platform'
2
- export * from './com'
3
- export * from './index-desc'
4
- export * from './item'
5
- export * from './permission'
6
- export * from './user'
7
- //# sourceMappingURL=index.d.ts.map
1
+ export * from './platform';
2
+ export * from './com';
3
+ export * from './index-desc';
4
+ export * from './item';
5
+ export * from './permission';
6
+ export * from './user';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- export declare function listItemTreeApi(params: any): Promise<import("axios").AxiosResponse<any, any>>;
2
- export declare function getPriceInfo(): Promise<import("axios").AxiosResponse<any, any>>;
3
- export declare function getItem(params: any): Promise<import("axios").AxiosResponse<any, any>>;
1
+ export declare function listItemTreeApi(params: any): Promise<import("axios").AxiosResponse<any>>;
2
+ export declare function getPriceInfo(): Promise<import("axios").AxiosResponse<any>>;
3
+ export declare function getItem(params: any): Promise<import("axios").AxiosResponse<any>>;
4
4
  //# sourceMappingURL=item.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../src/api/item.ts"],"names":[],"mappings":"AAKA,wBAAgB,eAAe,CAAC,MAAM,KAAA,oDAOrC;AACD,wBAAgB,YAAY,qDAE3B;AACD,wBAAgB,OAAO,CAAC,MAAM,KAAA,oDAE7B"}
1
+ {"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../src/api/item.ts"],"names":[],"mappings":"AAKA,wBAAgB,eAAe,CAAC,MAAM,KAAA,+CAOrC;AACD,wBAAgB,YAAY,gDAE3B;AACD,wBAAgB,OAAO,CAAC,MAAM,KAAA,+CAE7B"}
@@ -1,2 +1,2 @@
1
- export declare function getApplicationTreeApi(params: any): Promise<any>
2
- //# sourceMappingURL=permission.d.ts.map
1
+ export declare function getApplicationTreeApi(params: any): Promise<any>;
2
+ //# sourceMappingURL=permission.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"permission.d.ts","sourceRoot":"","sources":["../../src/api/permission.ts"],"names":[],"mappings":"AAQA,wBAAsB,qBAAqB,CAAC,MAAM,KAAA,gBAsBjD"}
1
+ {"version":3,"file":"permission.d.ts","sourceRoot":"","sources":["../../src/api/permission.ts"],"names":[],"mappings":"AASA,wBAAsB,qBAAqB,CAAC,MAAM,KAAA,gBA8BjD"}
@@ -0,0 +1,2 @@
1
+ export function getGlobalConfig(): Promise<any>;
2
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/api/platform/config.js"],"names":[],"mappings":"AASO,gDAYN"}
@@ -1,4 +1,4 @@
1
- export declare function getDictsMapApi(dictId: string): Promise<import("axios").AxiosResponse<any, any>>;
1
+ export declare function getDictsMapApi(dictId: string): Promise<import("axios").AxiosResponse<any>>;
2
2
  export declare function getDictApi(dictId: string): Promise<any>;
3
3
  export declare function getDictMapApi(dictIdArr: string[]): Promise<{}>;
4
4
  //# sourceMappingURL=dict.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dict.d.ts","sourceRoot":"","sources":["../../../src/api/platform/dict.ts"],"names":[],"mappings":"AAMA,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,oDAE5C;AAED,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,gBAgB9C;AAkBD,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,eActD"}
1
+ {"version":3,"file":"dict.d.ts","sourceRoot":"","sources":["../../../src/api/platform/dict.ts"],"names":[],"mappings":"AAMA,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,+CAE5C;AAED,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,gBAgB9C;AAkBD,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,eActD"}
@@ -2,4 +2,5 @@ export * from './dict';
2
2
  export * from './menu';
3
3
  export * from './oss';
4
4
  export * from './user';
5
+ export * from './config.js';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/platform/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,OAAO,CAAA;AACrB,cAAc,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/platform/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,OAAO,CAAA;AACrB,cAAc,QAAQ,CAAA;AACtB,cAAc,aAAa,CAAA"}
@@ -1,11 +1,11 @@
1
- export declare function getPermissionApi(): Promise<import("axios").AxiosResponse<any, any>>;
2
- export declare function getMenuHistoryApi(): Promise<import("axios").AxiosResponse<any, any>>;
3
- export declare function menuHistoryApi(params: any): Promise<import("axios").AxiosResponse<any, any>>;
4
- export declare function deleteMenuHistoryApi(historyId: any): Promise<import("axios").AxiosResponse<any, any>>;
5
- export declare function getMenuCollectApi(): Promise<import("axios").AxiosResponse<any, any>>;
6
- export declare function addMenuCollectApi(params: any): Promise<import("axios").AxiosResponse<any, any>>;
7
- export declare function deleteMenuCollectApi(collectId: any): Promise<import("axios").AxiosResponse<any, any>>;
8
- export declare function removeMenuCollectApi(params: any): Promise<import("axios").AxiosResponse<any, any>>;
9
- export declare function getAppListApi(): Promise<import("axios").AxiosResponse<any, any>>;
10
- export declare function getMaxTabNumValueApi(): Promise<import("axios").AxiosResponse<any, any>>;
1
+ export declare function getPermissionApi(): Promise<import("axios").AxiosResponse<any>>;
2
+ export declare function getMenuHistoryApi(): Promise<import("axios").AxiosResponse<any>>;
3
+ export declare function menuHistoryApi(params: any): Promise<import("axios").AxiosResponse<any>>;
4
+ export declare function deleteMenuHistoryApi(historyId: any): Promise<import("axios").AxiosResponse<any>>;
5
+ export declare function getMenuCollectApi(): Promise<import("axios").AxiosResponse<any>>;
6
+ export declare function addMenuCollectApi(params: any): Promise<import("axios").AxiosResponse<any>>;
7
+ export declare function deleteMenuCollectApi(collectId: any): Promise<import("axios").AxiosResponse<any>>;
8
+ export declare function removeMenuCollectApi(params: any): Promise<import("axios").AxiosResponse<any>>;
9
+ export declare function getAppListApi(): Promise<import("axios").AxiosResponse<any>>;
10
+ export declare function getMaxTabNumValueApi(): Promise<import("axios").AxiosResponse<any>>;
11
11
  //# sourceMappingURL=menu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../src/api/platform/menu.ts"],"names":[],"mappings":"AAKA,wBAAgB,gBAAgB,qDAE/B;AAED,wBAAgB,iBAAiB,qDAEhC;AAED,wBAAgB,cAAc,CAAC,MAAM,KAAA,oDAEpC;AAED,wBAAgB,oBAAoB,CAAC,SAAS,KAAA,oDAE7C;AAED,wBAAgB,iBAAiB,qDAEhC;AAED,wBAAgB,iBAAiB,CAAC,MAAM,KAAA,oDAEvC;AAED,wBAAgB,oBAAoB,CAAC,SAAS,KAAA,oDAE7C;AAED,wBAAgB,oBAAoB,CAAC,MAAM,KAAA,oDAE1C;AAED,wBAAgB,aAAa,qDAE5B;AAED,wBAAgB,oBAAoB,qDAEnC"}
1
+ {"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../src/api/platform/menu.ts"],"names":[],"mappings":"AAKA,wBAAgB,gBAAgB,gDAE/B;AAED,wBAAgB,iBAAiB,gDAEhC;AAED,wBAAgB,cAAc,CAAC,MAAM,KAAA,+CAEpC;AAED,wBAAgB,oBAAoB,CAAC,SAAS,KAAA,+CAE7C;AAED,wBAAgB,iBAAiB,gDAEhC;AAED,wBAAgB,iBAAiB,CAAC,MAAM,KAAA,+CAEvC;AAED,wBAAgB,oBAAoB,CAAC,SAAS,KAAA,+CAE7C;AAED,wBAAgB,oBAAoB,CAAC,MAAM,KAAA,+CAE1C;AAED,wBAAgB,aAAa,gDAE5B;AAED,wBAAgB,oBAAoB,gDAEnC"}
@@ -19,7 +19,7 @@ export declare function putOssFileUrl(): string;
19
19
  * @param responseType 数据类型,支持 arraybuffer | blob | document | json | text | stream
20
20
  * @returns 文件内容
21
21
  */
22
- export declare function getOssFileApi(fileId: string, responseType?: ResponseType): Promise<import("axios").AxiosResponse<any, any>>;
22
+ export declare function getOssFileApi(fileId: string, responseType?: ResponseType): Promise<import("axios").AxiosResponse<any>>;
23
23
  /**
24
24
  * 将文件上传到文档中心
25
25
  *
@@ -34,5 +34,13 @@ export declare function putOssFileApi(filename: string, blob: Blob): import("axi
34
34
  * @param fileId 文件Id
35
35
  * @returns 文件内容
36
36
  */
37
- export declare function getPreviewUrlApi(fileId: string): Promise<import("axios").AxiosResponse<any, any>>;
37
+ export declare function getPreviewUrlApi(fileId: string): Promise<import("axios").AxiosResponse<any>>;
38
+ /**
39
+ * 获取文档中心预览URL
40
+ *
41
+ * @param fileId 文件Id
42
+ * @param fileName 文件名
43
+ * @returns 文件内容
44
+ */
45
+ export declare function downLoadScDcApi(fileId: string, fileName: string): Promise<void>;
38
46
  //# sourceMappingURL=oss.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"oss.d.ts","sourceRoot":"","sources":["../../../src/api/platform/oss.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,YAAY,EAAE,MAAM,OAAO,CAAA;AAIxD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,SAAK,UAExC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,WAE5B;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,YAAY,oDAMxE;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,qCAUzD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,oDAQ9C"}
1
+ {"version":3,"file":"oss.d.ts","sourceRoot":"","sources":["../../../src/api/platform/oss.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,YAAY,EAAE,MAAM,OAAO,CAAA;AAIxD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,SAAK,UAExC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,WAE5B;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,YAAY,+CAMxE;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,qCAUzD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,+CAQ9C;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBA0DrE"}
@@ -3,10 +3,10 @@ export declare function loginApi({ userName, password, validCodeId, validCodeInp
3
3
  password: any;
4
4
  validCodeId: any;
5
5
  validCodeInput: any;
6
- }): Promise<import("axios").AxiosResponse<any, any>>;
7
- export declare function getUserInfoApi(): Promise<import("axios").AxiosResponse<any, any>>;
8
- export declare function getGlobalPolicyApi(): Promise<import("axios").AxiosResponse<any, any>>;
9
- export declare function updatePasswordApi(data: any): Promise<import("axios").AxiosResponse<any, any>>;
6
+ }): Promise<import("axios").AxiosResponse<any>>;
7
+ export declare function getUserInfoApi(): Promise<import("axios").AxiosResponse<any>>;
8
+ export declare function getGlobalPolicyApi(): Promise<import("axios").AxiosResponse<any>>;
9
+ export declare function updatePasswordApi(data: any): Promise<import("axios").AxiosResponse<any>>;
10
10
  export declare function getCaptchaURL(validCodeId: string): string;
11
- export declare function logoutApi(): Promise<import("axios").AxiosResponse<any, any>>;
11
+ export declare function logoutApi(): Promise<import("axios").AxiosResponse<any>>;
12
12
  //# sourceMappingURL=user.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/api/platform/user.ts"],"names":[],"mappings":"AAMA,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE;;;;;CAAA,oDAQ3E;AAED,wBAAgB,cAAc,qDAE7B;AAED,wBAAgB,kBAAkB,qDAEjC;AAED,wBAAgB,iBAAiB,CAAC,IAAI,KAAA,oDAErC;AAED,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,UAEhD;AAED,wBAAgB,SAAS,qDAExB"}
1
+ {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/api/platform/user.ts"],"names":[],"mappings":"AAMA,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE;;;;;CAAA,+CAQ3E;AAED,wBAAgB,cAAc,gDAE7B;AAED,wBAAgB,kBAAkB,gDAEjC;AAED,wBAAgB,iBAAiB,CAAC,IAAI,KAAA,+CAErC;AAED,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,UAEhD;AAED,wBAAgB,SAAS,gDAExB"}
@@ -1,2 +1,2 @@
1
- export declare function listUserTreeApi(params: any): Promise<any>
2
- //# sourceMappingURL=user.d.ts.map
1
+ export declare function listUserTreeApi(params: any): Promise<any>;
2
+ //# sourceMappingURL=user.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/api/user.ts"],"names":[],"mappings":"AAQA,wBAAsB,eAAe,CAAC,MAAM,KAAA,gBAoB3C"}
1
+ {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/api/user.ts"],"names":[],"mappings":"AAQA,wBAAsB,eAAe,CAAC,MAAM,KAAA,gBA2B3C"}