fast-vue-multi-pages 1.0.5 → 1.0.7

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 (29) hide show
  1. package/dist/cjs/FastVueMultiTool.d.ts +5 -0
  2. package/dist/cjs/FastVueMultiTool.js +5 -0
  3. package/dist/cjs/http/FastVueMultiHttp.d.ts +5 -90
  4. package/dist/cjs/http/FastVueMultiHttp.js +6 -148
  5. package/dist/cjs/http/FastVueMultiSimpleJsonResponse.d.ts +67 -0
  6. package/dist/cjs/http/FastVueMultiSimpleJsonResponse.js +126 -0
  7. package/dist/cjs/http/FastVueMultiSimpleRequestConfig.d.ts +21 -0
  8. package/dist/cjs/http/FastVueMultiSimpleRequestConfig.js +25 -0
  9. package/dist/cjs/index.d.ts +3 -1
  10. package/dist/cjs/index.js +5 -1
  11. package/dist/cjs/other/FastVueMultiBase64.d.ts +12 -0
  12. package/dist/cjs/other/FastVueMultiBase64.js +22 -0
  13. package/dist/cjs/other/FastVueMultiFile.d.ts +11 -0
  14. package/dist/cjs/other/FastVueMultiFile.js +36 -2
  15. package/dist/esm/FastVueMultiTool.d.ts +5 -0
  16. package/dist/esm/FastVueMultiTool.js +5 -1
  17. package/dist/esm/http/FastVueMultiHttp.d.ts +5 -90
  18. package/dist/esm/http/FastVueMultiHttp.js +5 -152
  19. package/dist/esm/http/FastVueMultiSimpleJsonResponse.d.ts +67 -0
  20. package/dist/esm/http/FastVueMultiSimpleJsonResponse.js +127 -0
  21. package/dist/esm/http/FastVueMultiSimpleRequestConfig.d.ts +21 -0
  22. package/dist/esm/http/FastVueMultiSimpleRequestConfig.js +30 -0
  23. package/dist/esm/index.d.ts +3 -1
  24. package/dist/esm/index.js +4 -2
  25. package/dist/esm/other/FastVueMultiBase64.d.ts +12 -0
  26. package/dist/esm/other/FastVueMultiBase64.js +27 -0
  27. package/dist/esm/other/FastVueMultiFile.d.ts +11 -0
  28. package/dist/esm/other/FastVueMultiFile.js +68 -23
  29. package/package.json +1 -1
@@ -10,6 +10,7 @@ import { FastVueMultiFunction } from "./other/FastVueMultiFunction";
10
10
  import { FastVueMultiElement } from "./other/FastVueMultiElement";
11
11
  import { FastVueMultiWindow } from "./other/FastVueMultiWindow";
12
12
  import { FastVueMultiFile } from "./other/FastVueMultiFile";
13
+ import { FastVueMultiBase64 } from "./other/FastVueMultiBase64";
13
14
  /**
14
15
  * FastBaseApp 手机APP功能工具类
15
16
  */
@@ -66,4 +67,8 @@ export declare class FastVueMultiTool {
66
67
  * 文件选择器
67
68
  */
68
69
  static File: typeof FastVueMultiFile;
70
+ /**
71
+ * base64相关操作
72
+ */
73
+ static Base64: typeof FastVueMultiBase64;
69
74
  }
@@ -14,6 +14,7 @@ const FastVueMultiFunction_1 = require("./other/FastVueMultiFunction");
14
14
  const FastVueMultiElement_1 = require("./other/FastVueMultiElement");
15
15
  const FastVueMultiWindow_1 = require("./other/FastVueMultiWindow");
16
16
  const FastVueMultiFile_1 = require("./other/FastVueMultiFile");
17
+ const FastVueMultiBase64_1 = require("./other/FastVueMultiBase64");
17
18
  /**
18
19
  * FastBaseApp 手机APP功能工具类
19
20
  */
@@ -70,5 +71,9 @@ class FastVueMultiTool {
70
71
  * 文件选择器
71
72
  */
72
73
  static File = FastVueMultiFile_1.FastVueMultiFile;
74
+ /**
75
+ * base64相关操作
76
+ */
77
+ static Base64 = FastVueMultiBase64_1.FastVueMultiBase64;
73
78
  }
74
79
  exports.FastVueMultiTool = FastVueMultiTool;
@@ -1,4 +1,6 @@
1
1
  import { AxiosPromise } from "axios";
2
+ import { FastVueMultiSimpleJsonResponse } from "./FastVueMultiSimpleJsonResponse";
3
+ import { FastVueMultiSimpleRequestConfig } from "./FastVueMultiSimpleRequestConfig";
2
4
  /**
3
5
  * FastVueMultiHttp 网咯请求接口工具类
4
6
  * @author Janesen
@@ -117,7 +119,7 @@ export declare namespace FastVueMultiHttp {
117
119
  * @param config 请求配置
118
120
  * @param callBack 请求接口回调函数,在使用alwaysCache和alwaysBackRequest参数为true时,必须使用回调函数接收
119
121
  */
120
- static request(method: string, url: string, params: any, config?: SimpleRequestConfig, callBack?: (result: SimpleJsonResponse) => void): Promise<SimpleJsonResponse>;
122
+ static request(method: string, url: string, params: any, config?: FastVueMultiSimpleRequestConfig, callBack?: (result: FastVueMultiSimpleJsonResponse) => void): Promise<FastVueMultiSimpleJsonResponse>;
121
123
  /**
122
124
  * post请求接口
123
125
  * @param url 接口地址 完整的地址,例如:http://loalhost:8080/user/login
@@ -125,7 +127,7 @@ export declare namespace FastVueMultiHttp {
125
127
  * @param config 请求配置
126
128
  * @param callBack 请求接口回调函数,在使用alwaysCache和alwaysBackRequest参数为true时,必须使用回调函数接收
127
129
  */
128
- static post(url: string, params: any, config?: SimpleRequestConfig, callBack?: (result: SimpleJsonResponse) => void): Promise<SimpleJsonResponse>;
130
+ static post(url: string, params: any, config?: FastVueMultiSimpleRequestConfig, callBack?: (result: FastVueMultiSimpleJsonResponse) => void): Promise<FastVueMultiSimpleJsonResponse>;
129
131
  /**
130
132
  * get请求接口
131
133
  * @param url 接口地址 完整的地址,例如:http://loalhost:8080/user/login
@@ -133,93 +135,6 @@ export declare namespace FastVueMultiHttp {
133
135
  * @param config 请求配置
134
136
  * @param callBack 请求接口回调函数,在使用alwaysCache和alwaysBackRequest参数为true时,必须使用回调函数接收
135
137
  */
136
- static get(url: string, params: any, config?: SimpleRequestConfig, callBack?: (result: SimpleJsonResponse) => void): Promise<SimpleJsonResponse>;
137
- }
138
- /**
139
- * 常规返回数据的格式解析类 JSON:{success:true,message:"消息",data:{}}
140
- */
141
- class SimpleJsonResponse {
142
- responseData: any;
143
- cacheData: boolean;
144
- requestConfig: SimpleRequestConfig;
145
- constructor(responseData: any, cacheData?: boolean);
146
- /**
147
- * 获取接口返回的原始数据
148
- */
149
- getResponseData(): any;
150
- /**
151
- * 判断当前回调的数据是否是缓存的数据
152
- */
153
- isCacheData(): boolean;
154
- /**
155
- * 判断接口是否请求成功-success
156
- */
157
- isSuccess(): boolean;
158
- /**
159
- * 获取接口请求返回的状态值-code
160
- */
161
- getCode(): number;
162
- /**
163
- * 获取接口请求返回的消息提示-message
164
- */
165
- getMessage(): string;
166
- /**
167
- * 获取接口请求返回的数据-data
168
- */
169
- getData(): any;
170
- /**
171
- * 获取接口请求返回的其他数据,例如:data_1、data_2
172
- * @param suffixIndex 数据后缀,例如:data_1 后缀传 1
173
- */
174
- getOtherData(suffixIndex: number): any;
175
- /**
176
- * 判断接口返回的数据data是否是分页的数据
177
- */
178
- isPageData(): boolean;
179
- /**
180
- * 获取接口返回的数据列表,如果data是分页数据则返回分页的列表,否则返回data
181
- */
182
- getList(): any[];
183
- /**
184
- * 获取接口列表分页数据的页数
185
- */
186
- getPage(): number;
187
- /**
188
- * 获取接口列表分页数据的总页数
189
- */
190
- getTotalPage(): number;
191
- /**
192
- * 获取接口列表分页数据的总行数
193
- */
194
- getTotalRow(): number;
195
- /**
196
- * 获取接口列表分页数据的每页大小
197
- */
198
- getPageSize(): number;
199
- /**
200
- * 是否已加载结束,当page>=totalPage 或 list 为空时,认为加载已结束
201
- */
202
- isFinished(): boolean;
203
- }
204
- /**
205
- * 接口请求配置类
206
- */
207
- class SimpleRequestConfig {
208
- /**
209
- * 是否追加全局参数,默认true
210
- */
211
- finalParams: boolean;
212
- /**
213
- * 是否缓存数据,true:检测到有当前接口的缓存数据时,将回调缓存的数据
214
- */
215
- cache: boolean;
216
- /**
217
- * 是否总是缓存数据,true:无论是否已有缓存数据,都将请求接口并刷新当前缓存的数据,不支持then方法接收
218
- */
219
- alwaysCache: boolean;
220
- /**
221
- * 是否总是回调接口请求返回的数据,true:如果有缓存第一次回调缓存数据,第二次回调接口返回的数据,否则值回调一次接口返回的数据,不支持then方法接收
222
- */
223
- alwaysBackRequest: boolean;
138
+ static get(url: string, params: any, config?: FastVueMultiSimpleRequestConfig, callBack?: (result: FastVueMultiSimpleJsonResponse) => void): Promise<FastVueMultiSimpleJsonResponse>;
224
139
  }
225
140
  }
@@ -6,6 +6,8 @@ const axios_1 = tslib_1.__importDefault(require("axios"));
6
6
  const lodash_1 = tslib_1.__importDefault(require("lodash"));
7
7
  const FastVueMultiConfig_1 = require("../vue/FastVueMultiConfig");
8
8
  const FastVueMultiStore_1 = require("../other/FastVueMultiStore");
9
+ const FastVueMultiSimpleJsonResponse_1 = require("./FastVueMultiSimpleJsonResponse");
10
+ const FastVueMultiSimpleRequestConfig_1 = require("./FastVueMultiSimpleRequestConfig");
9
11
  /**
10
12
  * FastVueMultiHttp 网咯请求接口工具类
11
13
  * @author Janesen
@@ -354,7 +356,7 @@ var FastVueMultiHttp;
354
356
  let result = FastVueMultiStore_1.FastVueMultiStore.getValue(cacheKey);
355
357
  if (result.success) {
356
358
  cachedData = true;
357
- let fastResponseData = new SimpleJsonResponse(JSON.parse(result.data), true);
359
+ let fastResponseData = new FastVueMultiSimpleJsonResponse_1.FastVueMultiSimpleJsonResponse(JSON.parse(result.data), true);
358
360
  fastResponseData.requestConfig = config;
359
361
  resolved(fastResponseData);
360
362
  if (callBack) {
@@ -366,7 +368,7 @@ var FastVueMultiHttp;
366
368
  }
367
369
  }
368
370
  if (!url) {
369
- let fastResponseData = new SimpleJsonResponse({
371
+ let fastResponseData = new FastVueMultiSimpleJsonResponse_1.FastVueMultiSimpleJsonResponse({
370
372
  success: false,
371
373
  message: "JS错误:请求地址不可为空!"
372
374
  });
@@ -378,9 +380,9 @@ var FastVueMultiHttp;
378
380
  }
379
381
  FastVueMultiHttp.Base.doRequest(method, url, params).then(function (response) {
380
382
  if (!config) {
381
- config = new FastVueMultiHttp.SimpleRequestConfig();
383
+ config = new FastVueMultiSimpleRequestConfig_1.FastVueMultiSimpleRequestConfig();
382
384
  }
383
- let fastResponseData = new SimpleJsonResponse(response.data);
385
+ let fastResponseData = new FastVueMultiSimpleJsonResponse_1.FastVueMultiSimpleJsonResponse(response.data);
384
386
  fastResponseData.requestConfig = config;
385
387
  if (config.cache) {
386
388
  if (config.alwaysBackRequest || !cachedData) {
@@ -425,148 +427,4 @@ var FastVueMultiHttp;
425
427
  }
426
428
  }
427
429
  FastVueMultiHttp.Simple = Simple;
428
- /**
429
- * 常规返回数据的格式解析类 JSON:{success:true,message:"消息",data:{}}
430
- */
431
- class SimpleJsonResponse {
432
- responseData;
433
- cacheData = false;
434
- requestConfig = new FastVueMultiHttp.SimpleRequestConfig();
435
- constructor(responseData, cacheData) {
436
- this.responseData = responseData;
437
- if (cacheData == undefined) {
438
- cacheData = false;
439
- }
440
- this.cacheData = cacheData;
441
- }
442
- /**
443
- * 获取接口返回的原始数据
444
- */
445
- getResponseData() {
446
- return this.responseData;
447
- }
448
- /**
449
- * 判断当前回调的数据是否是缓存的数据
450
- */
451
- isCacheData() {
452
- return this.cacheData;
453
- }
454
- /**
455
- * 判断接口是否请求成功-success
456
- */
457
- isSuccess() {
458
- return this.responseData.success;
459
- }
460
- /**
461
- * 获取接口请求返回的状态值-code
462
- */
463
- getCode() {
464
- return this.responseData.code;
465
- }
466
- /**
467
- * 获取接口请求返回的消息提示-message
468
- */
469
- getMessage() {
470
- return this.responseData.message;
471
- }
472
- /**
473
- * 获取接口请求返回的数据-data
474
- */
475
- getData() {
476
- return this.responseData.data;
477
- }
478
- /**
479
- * 获取接口请求返回的其他数据,例如:data_1、data_2
480
- * @param suffixIndex 数据后缀,例如:data_1 后缀传 1
481
- */
482
- getOtherData(suffixIndex) {
483
- return this.responseData["data_" + suffixIndex];
484
- }
485
- /**
486
- * 判断接口返回的数据data是否是分页的数据
487
- */
488
- isPageData() {
489
- if (!this.responseData.data) {
490
- return false;
491
- }
492
- return this.responseData.data.hasOwnProperty("page");
493
- }
494
- /**
495
- * 获取接口返回的数据列表,如果data是分页数据则返回分页的列表,否则返回data
496
- */
497
- getList() {
498
- if (this.isPageData()) {
499
- return this.responseData.data.list;
500
- }
501
- if (this.responseData.data) {
502
- return this.responseData.data;
503
- }
504
- return [];
505
- }
506
- /**
507
- * 获取接口列表分页数据的页数
508
- */
509
- getPage() {
510
- if (this.isPageData()) {
511
- return this.responseData.data.page;
512
- }
513
- return -1;
514
- }
515
- /**
516
- * 获取接口列表分页数据的总页数
517
- */
518
- getTotalPage() {
519
- if (this.isPageData()) {
520
- return this.responseData.data.totalPage;
521
- }
522
- return -1;
523
- }
524
- /**
525
- * 获取接口列表分页数据的总行数
526
- */
527
- getTotalRow() {
528
- if (this.isPageData()) {
529
- return this.responseData.data.totalRow;
530
- }
531
- return -1;
532
- }
533
- /**
534
- * 获取接口列表分页数据的每页大小
535
- */
536
- getPageSize() {
537
- if (this.isPageData()) {
538
- return this.responseData.data.pageSize;
539
- }
540
- return -1;
541
- }
542
- /**
543
- * 是否已加载结束,当page>=totalPage 或 list 为空时,认为加载已结束
544
- */
545
- isFinished() {
546
- return this.getPage() >= this.getTotalPage() || this.getList().length === 0;
547
- }
548
- }
549
- FastVueMultiHttp.SimpleJsonResponse = SimpleJsonResponse;
550
- /**
551
- * 接口请求配置类
552
- */
553
- class SimpleRequestConfig {
554
- /**
555
- * 是否追加全局参数,默认true
556
- */
557
- finalParams = true;
558
- /**
559
- * 是否缓存数据,true:检测到有当前接口的缓存数据时,将回调缓存的数据
560
- */
561
- cache = false;
562
- /**
563
- * 是否总是缓存数据,true:无论是否已有缓存数据,都将请求接口并刷新当前缓存的数据,不支持then方法接收
564
- */
565
- alwaysCache = false;
566
- /**
567
- * 是否总是回调接口请求返回的数据,true:如果有缓存第一次回调缓存数据,第二次回调接口返回的数据,否则值回调一次接口返回的数据,不支持then方法接收
568
- */
569
- alwaysBackRequest = false;
570
- }
571
- FastVueMultiHttp.SimpleRequestConfig = SimpleRequestConfig;
572
430
  })(FastVueMultiHttp || (exports.FastVueMultiHttp = FastVueMultiHttp = {}));
@@ -0,0 +1,67 @@
1
+ import { FastVueMultiSimpleRequestConfig } from "./FastVueMultiSimpleRequestConfig";
2
+ /**
3
+ * 常规返回数据的格式解析类 JSON:{success:true,message:"消息",data:{}}
4
+ */
5
+ export declare class FastVueMultiSimpleJsonResponse {
6
+ responseData: any;
7
+ cacheData: boolean;
8
+ requestConfig: FastVueMultiSimpleRequestConfig;
9
+ constructor(responseData: any, cacheData?: boolean);
10
+ /**
11
+ * 获取接口返回的原始数据
12
+ */
13
+ getResponseData(): any;
14
+ /**
15
+ * 判断当前回调的数据是否是缓存的数据
16
+ */
17
+ isCacheData(): boolean;
18
+ /**
19
+ * 判断接口是否请求成功-success
20
+ */
21
+ isSuccess(): boolean;
22
+ /**
23
+ * 获取接口请求返回的状态值-code
24
+ */
25
+ getCode(): number;
26
+ /**
27
+ * 获取接口请求返回的消息提示-message
28
+ */
29
+ getMessage(): string;
30
+ /**
31
+ * 获取接口请求返回的数据-data
32
+ */
33
+ getData(): any;
34
+ /**
35
+ * 获取接口请求返回的其他数据,例如:data_1、data_2
36
+ * @param suffixIndex 数据后缀,例如:data_1 后缀传 1
37
+ */
38
+ getOtherData(suffixIndex: number): any;
39
+ /**
40
+ * 判断接口返回的数据data是否是分页的数据
41
+ */
42
+ isPageData(): boolean;
43
+ /**
44
+ * 获取接口返回的数据列表,如果data是分页数据则返回分页的列表,否则返回data
45
+ */
46
+ getList(): any[];
47
+ /**
48
+ * 获取接口列表分页数据的页数
49
+ */
50
+ getPage(): number;
51
+ /**
52
+ * 获取接口列表分页数据的总页数
53
+ */
54
+ getTotalPage(): number;
55
+ /**
56
+ * 获取接口列表分页数据的总行数
57
+ */
58
+ getTotalRow(): number;
59
+ /**
60
+ * 获取接口列表分页数据的每页大小
61
+ */
62
+ getPageSize(): number;
63
+ /**
64
+ * 是否已加载结束,当page>=totalPage 或 list 为空时,认为加载已结束
65
+ */
66
+ isFinished(): boolean;
67
+ }
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FastVueMultiSimpleJsonResponse = void 0;
4
+ const FastVueMultiSimpleRequestConfig_1 = require("./FastVueMultiSimpleRequestConfig");
5
+ /**
6
+ * 常规返回数据的格式解析类 JSON:{success:true,message:"消息",data:{}}
7
+ */
8
+ class FastVueMultiSimpleJsonResponse {
9
+ responseData;
10
+ cacheData = false;
11
+ requestConfig = new FastVueMultiSimpleRequestConfig_1.FastVueMultiSimpleRequestConfig();
12
+ constructor(responseData, cacheData) {
13
+ this.responseData = responseData;
14
+ if (cacheData == undefined) {
15
+ cacheData = false;
16
+ }
17
+ this.cacheData = cacheData;
18
+ }
19
+ /**
20
+ * 获取接口返回的原始数据
21
+ */
22
+ getResponseData() {
23
+ return this.responseData;
24
+ }
25
+ /**
26
+ * 判断当前回调的数据是否是缓存的数据
27
+ */
28
+ isCacheData() {
29
+ return this.cacheData;
30
+ }
31
+ /**
32
+ * 判断接口是否请求成功-success
33
+ */
34
+ isSuccess() {
35
+ return this.responseData.success;
36
+ }
37
+ /**
38
+ * 获取接口请求返回的状态值-code
39
+ */
40
+ getCode() {
41
+ return this.responseData.code;
42
+ }
43
+ /**
44
+ * 获取接口请求返回的消息提示-message
45
+ */
46
+ getMessage() {
47
+ return this.responseData.message;
48
+ }
49
+ /**
50
+ * 获取接口请求返回的数据-data
51
+ */
52
+ getData() {
53
+ return this.responseData.data;
54
+ }
55
+ /**
56
+ * 获取接口请求返回的其他数据,例如:data_1、data_2
57
+ * @param suffixIndex 数据后缀,例如:data_1 后缀传 1
58
+ */
59
+ getOtherData(suffixIndex) {
60
+ return this.responseData["data_" + suffixIndex];
61
+ }
62
+ /**
63
+ * 判断接口返回的数据data是否是分页的数据
64
+ */
65
+ isPageData() {
66
+ if (!this.responseData.data) {
67
+ return false;
68
+ }
69
+ return this.responseData.data.hasOwnProperty("page");
70
+ }
71
+ /**
72
+ * 获取接口返回的数据列表,如果data是分页数据则返回分页的列表,否则返回data
73
+ */
74
+ getList() {
75
+ if (this.isPageData()) {
76
+ return this.responseData.data.list;
77
+ }
78
+ if (this.responseData.data) {
79
+ return this.responseData.data;
80
+ }
81
+ return [];
82
+ }
83
+ /**
84
+ * 获取接口列表分页数据的页数
85
+ */
86
+ getPage() {
87
+ if (this.isPageData()) {
88
+ return this.responseData.data.page;
89
+ }
90
+ return -1;
91
+ }
92
+ /**
93
+ * 获取接口列表分页数据的总页数
94
+ */
95
+ getTotalPage() {
96
+ if (this.isPageData()) {
97
+ return this.responseData.data.totalPage;
98
+ }
99
+ return -1;
100
+ }
101
+ /**
102
+ * 获取接口列表分页数据的总行数
103
+ */
104
+ getTotalRow() {
105
+ if (this.isPageData()) {
106
+ return this.responseData.data.totalRow;
107
+ }
108
+ return -1;
109
+ }
110
+ /**
111
+ * 获取接口列表分页数据的每页大小
112
+ */
113
+ getPageSize() {
114
+ if (this.isPageData()) {
115
+ return this.responseData.data.pageSize;
116
+ }
117
+ return -1;
118
+ }
119
+ /**
120
+ * 是否已加载结束,当page>=totalPage 或 list 为空时,认为加载已结束
121
+ */
122
+ isFinished() {
123
+ return this.getPage() >= this.getTotalPage() || this.getList().length === 0;
124
+ }
125
+ }
126
+ exports.FastVueMultiSimpleJsonResponse = FastVueMultiSimpleJsonResponse;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * 接口请求配置类
3
+ */
4
+ export declare class FastVueMultiSimpleRequestConfig {
5
+ /**
6
+ * 是否追加全局参数,默认true
7
+ */
8
+ finalParams: boolean;
9
+ /**
10
+ * 是否缓存数据,true:检测到有当前接口的缓存数据时,将回调缓存的数据
11
+ */
12
+ cache: boolean;
13
+ /**
14
+ * 是否总是缓存数据,true:无论是否已有缓存数据,都将请求接口并刷新当前缓存的数据,不支持then方法接收
15
+ */
16
+ alwaysCache: boolean;
17
+ /**
18
+ * 是否总是回调接口请求返回的数据,true:如果有缓存第一次回调缓存数据,第二次回调接口返回的数据,否则值回调一次接口返回的数据,不支持then方法接收
19
+ */
20
+ alwaysBackRequest: boolean;
21
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FastVueMultiSimpleRequestConfig = void 0;
4
+ /**
5
+ * 接口请求配置类
6
+ */
7
+ class FastVueMultiSimpleRequestConfig {
8
+ /**
9
+ * 是否追加全局参数,默认true
10
+ */
11
+ finalParams = true;
12
+ /**
13
+ * 是否缓存数据,true:检测到有当前接口的缓存数据时,将回调缓存的数据
14
+ */
15
+ cache = false;
16
+ /**
17
+ * 是否总是缓存数据,true:无论是否已有缓存数据,都将请求接口并刷新当前缓存的数据,不支持then方法接收
18
+ */
19
+ alwaysCache = false;
20
+ /**
21
+ * 是否总是回调接口请求返回的数据,true:如果有缓存第一次回调缓存数据,第二次回调接口返回的数据,否则值回调一次接口返回的数据,不支持then方法接收
22
+ */
23
+ alwaysBackRequest = false;
24
+ }
25
+ exports.FastVueMultiSimpleRequestConfig = FastVueMultiSimpleRequestConfig;
@@ -1,2 +1,4 @@
1
1
  import { FastVueMultiTool } from "./FastVueMultiTool";
2
- export { FastVueMultiTool };
2
+ import { FastVueMultiSimpleJsonResponse } from "./http/FastVueMultiSimpleJsonResponse";
3
+ import { FastVueMultiSimpleRequestConfig } from "./http/FastVueMultiSimpleRequestConfig";
4
+ export { FastVueMultiTool, FastVueMultiSimpleJsonResponse, FastVueMultiSimpleRequestConfig };
package/dist/cjs/index.js CHANGED
@@ -1,5 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FastVueMultiTool = void 0;
3
+ exports.FastVueMultiSimpleRequestConfig = exports.FastVueMultiSimpleJsonResponse = exports.FastVueMultiTool = void 0;
4
4
  const FastVueMultiTool_1 = require("./FastVueMultiTool");
5
5
  Object.defineProperty(exports, "FastVueMultiTool", { enumerable: true, get: function () { return FastVueMultiTool_1.FastVueMultiTool; } });
6
+ const FastVueMultiSimpleJsonResponse_1 = require("./http/FastVueMultiSimpleJsonResponse");
7
+ Object.defineProperty(exports, "FastVueMultiSimpleJsonResponse", { enumerable: true, get: function () { return FastVueMultiSimpleJsonResponse_1.FastVueMultiSimpleJsonResponse; } });
8
+ const FastVueMultiSimpleRequestConfig_1 = require("./http/FastVueMultiSimpleRequestConfig");
9
+ Object.defineProperty(exports, "FastVueMultiSimpleRequestConfig", { enumerable: true, get: function () { return FastVueMultiSimpleRequestConfig_1.FastVueMultiSimpleRequestConfig; } });
@@ -0,0 +1,12 @@
1
+ export declare class FastVueMultiBase64 {
2
+ /**
3
+ * 转码base64
4
+ * @param content
5
+ */
6
+ static encode(content: any): string;
7
+ /**
8
+ * 解码base64
9
+ * @param content
10
+ */
11
+ static decode(content: string): string;
12
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FastVueMultiBase64 = void 0;
4
+ class FastVueMultiBase64 {
5
+ /**
6
+ * 转码base64
7
+ * @param content
8
+ */
9
+ static encode(content) {
10
+ const Base64 = require("js-base64");
11
+ return Base64.encode(content);
12
+ }
13
+ /**
14
+ * 解码base64
15
+ * @param content
16
+ */
17
+ static decode(content) {
18
+ const Base64 = require("js-base64");
19
+ return Base64.decode(content);
20
+ }
21
+ }
22
+ exports.FastVueMultiBase64 = FastVueMultiBase64;
@@ -4,4 +4,15 @@ export declare class FastVueMultiFile {
4
4
  * @param multi
5
5
  */
6
6
  static showUploadImage(multi: boolean): Promise<any>;
7
+ /**
8
+ * 将base64转为file对象
9
+ * @param content base64内容
10
+ * @param fileName 文件名
11
+ */
12
+ static base64ToFile(content: string, fileName: string): File;
13
+ /**
14
+ * 将file对象转为base64
15
+ * @param file
16
+ */
17
+ static fileToBase64(file: File): Promise<unknown>;
7
18
  }