uniapp-request-sdk 1.3.9 → 1.4.0
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/index.d.ts +20 -1
- package/dist/index.esm.js +45 -2
- package/dist/index.umd.js +287 -0
- package/package.json +16 -2
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ interface IParams {
|
|
|
11
11
|
maxRetryCount?: number;
|
|
12
12
|
/** 请求超时时间默认10s,ms为单位 */
|
|
13
13
|
timeout?: number;
|
|
14
|
+
/** 上传文件的请求超时时间,ms为单位 */
|
|
15
|
+
uploadTimeout?: number;
|
|
14
16
|
/** 请求尝试延迟时间默认3s,ms为单位 */
|
|
15
17
|
retryDelay?: number;
|
|
16
18
|
/** token,APP初始化给到小程序的token */
|
|
@@ -24,6 +26,9 @@ interface IParams {
|
|
|
24
26
|
/** 自定义得到token的函数,默认使用从客户端获取token的方式 */
|
|
25
27
|
getTokenFun?: () => Promise<string>;
|
|
26
28
|
}
|
|
29
|
+
declare function requestPromise(options?: RequestOptions & {
|
|
30
|
+
timeout: number;
|
|
31
|
+
}): Promise<RequestSuccessCallbackResult>;
|
|
27
32
|
declare class UniRequest {
|
|
28
33
|
/** 基准路径 */
|
|
29
34
|
private baseUrl;
|
|
@@ -34,6 +39,8 @@ declare class UniRequest {
|
|
|
34
39
|
private maxRetryCount;
|
|
35
40
|
/** 超时时间 */
|
|
36
41
|
private timeout;
|
|
42
|
+
/** 上传文件的超时时间 */
|
|
43
|
+
private uploadTimeout;
|
|
37
44
|
private retryDelay;
|
|
38
45
|
private token?;
|
|
39
46
|
private tokenEventName;
|
|
@@ -51,7 +58,9 @@ declare class UniRequest {
|
|
|
51
58
|
method: RequestOptions['method'];
|
|
52
59
|
data?: RequestOptions['data'];
|
|
53
60
|
header?: RequestOptions['header'];
|
|
54
|
-
|
|
61
|
+
/** 超时时间 */
|
|
62
|
+
timeout?: number;
|
|
63
|
+
} & RequestOptions & UploadFileOption, callbackPromise?: typeof requestPromise): Promise<T>;
|
|
55
64
|
/**
|
|
56
65
|
* post请求
|
|
57
66
|
* @param url
|
|
@@ -63,6 +72,16 @@ declare class UniRequest {
|
|
|
63
72
|
get<T>(url: string, data?: {}, header?: Record<string, string>): Promise<T>;
|
|
64
73
|
delete<T>(url: string, data?: {}, header?: Record<string, string>): Promise<T>;
|
|
65
74
|
put<T>(url: string, data?: {}, header?: Record<string, string>): Promise<T>;
|
|
75
|
+
/**
|
|
76
|
+
* 文件上传
|
|
77
|
+
* @param url 上传的url
|
|
78
|
+
* @param filePath 文件路径
|
|
79
|
+
* @param formData HTTP 请求中其他额外的 form data
|
|
80
|
+
* @param name 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容,默认key为file
|
|
81
|
+
* @param header
|
|
82
|
+
* @returns
|
|
83
|
+
*/
|
|
84
|
+
uploadFile<T>(url: string, filePath: string, formData?: Record<string, any>, name?: string, header?: Record<string, string>): Promise<T>;
|
|
66
85
|
}
|
|
67
86
|
|
|
68
87
|
export { IParams, UniRequest as default };
|
package/dist/index.esm.js
CHANGED
|
@@ -43,6 +43,14 @@ function requestPromise(options) {
|
|
|
43
43
|
}));
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
+
function uploadFilePromise(options) {
|
|
47
|
+
return new Promise(function (res, rej) {
|
|
48
|
+
uni.uploadFile(Object.assign(Object.assign({}, options), {
|
|
49
|
+
success: res,
|
|
50
|
+
fail: rej
|
|
51
|
+
}));
|
|
52
|
+
});
|
|
53
|
+
}
|
|
46
54
|
/** 得到小程序的token */
|
|
47
55
|
function getToken(eventName) {
|
|
48
56
|
return new Promise(function (res, rej) {
|
|
@@ -66,6 +74,8 @@ var UniRequest = /*#__PURE__*/function () {
|
|
|
66
74
|
this.maxRetryCount = 3;
|
|
67
75
|
/** 超时时间 */
|
|
68
76
|
this.timeout = 10000;
|
|
77
|
+
/** 上传文件的超时时间 */
|
|
78
|
+
this.uploadTimeout = 5000;
|
|
69
79
|
this.retryDelay = 3000;
|
|
70
80
|
this.tokenEventName = 'getToken';
|
|
71
81
|
/** token的header名称,默认Authorization */
|
|
@@ -103,6 +113,7 @@ var UniRequest = /*#__PURE__*/function () {
|
|
|
103
113
|
key: "request",
|
|
104
114
|
value: function request(params) {
|
|
105
115
|
var _this3 = this;
|
|
116
|
+
var callbackPromise = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : requestPromise;
|
|
106
117
|
var url = params.url;
|
|
107
118
|
/** 如果是http开头的,则不需要加入baseUrl */
|
|
108
119
|
if (!/^https?:\/\//.test(url)) {
|
|
@@ -116,11 +127,19 @@ var UniRequest = /*#__PURE__*/function () {
|
|
|
116
127
|
return new Promise(function (res, rej) {
|
|
117
128
|
var retryFucntion = function retryFucntion() {
|
|
118
129
|
/** 因为token需要动态获取,因此放入这里 */
|
|
130
|
+
// #ifndef H5
|
|
119
131
|
header[_this3.tokenHeader] = "".concat(_this3.tokenPrefix).concat(_this3.token);
|
|
120
|
-
|
|
132
|
+
// #endif
|
|
133
|
+
/** 针对h5调试的时候,因为塞入cookie是不安全的,因此无需塞入cookie,使用登录页后,后端塞入的cookie */
|
|
134
|
+
// #ifdef H5
|
|
135
|
+
if (!['cookie'].includes(_this3.tokenHeader)) {
|
|
136
|
+
header[_this3.tokenHeader] = "".concat(_this3.tokenPrefix).concat(_this3.token);
|
|
137
|
+
}
|
|
138
|
+
// #endif
|
|
139
|
+
callbackPromise(Object.assign(Object.assign({}, params), {
|
|
121
140
|
header: header,
|
|
122
141
|
url: url,
|
|
123
|
-
timeout: _this3.timeout
|
|
142
|
+
timeout: params.timeout || _this3.timeout
|
|
124
143
|
})).then(function (resData) {
|
|
125
144
|
var statusCode = resData.statusCode,
|
|
126
145
|
data = resData.data;
|
|
@@ -227,6 +246,30 @@ var UniRequest = /*#__PURE__*/function () {
|
|
|
227
246
|
method: 'PUT'
|
|
228
247
|
});
|
|
229
248
|
}
|
|
249
|
+
/**
|
|
250
|
+
* 文件上传
|
|
251
|
+
* @param url 上传的url
|
|
252
|
+
* @param filePath 文件路径
|
|
253
|
+
* @param formData HTTP 请求中其他额外的 form data
|
|
254
|
+
* @param name 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容,默认key为file
|
|
255
|
+
* @param header
|
|
256
|
+
* @returns
|
|
257
|
+
*/
|
|
258
|
+
}, {
|
|
259
|
+
key: "uploadFile",
|
|
260
|
+
value: function uploadFile(url, filePath, formData) {
|
|
261
|
+
var name = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'file';
|
|
262
|
+
var header = arguments.length > 4 ? arguments[4] : undefined;
|
|
263
|
+
return this.request({
|
|
264
|
+
url: url,
|
|
265
|
+
filePath: filePath,
|
|
266
|
+
formData: formData,
|
|
267
|
+
name: name,
|
|
268
|
+
header: header,
|
|
269
|
+
timeout: this.uploadTimeout,
|
|
270
|
+
method: 'PUT'
|
|
271
|
+
}, uploadFilePromise);
|
|
272
|
+
}
|
|
230
273
|
}]);
|
|
231
274
|
return UniRequest;
|
|
232
275
|
}();
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.UniappRequestSdk = {}));
|
|
5
|
+
})(this, (function (exports) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _classCallCheck(instance, Constructor) {
|
|
8
|
+
if (!(instance instanceof Constructor)) {
|
|
9
|
+
throw new TypeError("Cannot call a class as a function");
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function _defineProperties(target, props) {
|
|
13
|
+
for (var i = 0; i < props.length; i++) {
|
|
14
|
+
var descriptor = props[i];
|
|
15
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
16
|
+
descriptor.configurable = true;
|
|
17
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
18
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
22
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
23
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
24
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
25
|
+
writable: false
|
|
26
|
+
});
|
|
27
|
+
return Constructor;
|
|
28
|
+
}
|
|
29
|
+
function _toPrimitive(input, hint) {
|
|
30
|
+
if (typeof input !== "object" || input === null) return input;
|
|
31
|
+
var prim = input[Symbol.toPrimitive];
|
|
32
|
+
if (prim !== undefined) {
|
|
33
|
+
var res = prim.call(input, hint || "default");
|
|
34
|
+
if (typeof res !== "object") return res;
|
|
35
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
36
|
+
}
|
|
37
|
+
return (hint === "string" ? String : Number)(input);
|
|
38
|
+
}
|
|
39
|
+
function _toPropertyKey(arg) {
|
|
40
|
+
var key = _toPrimitive(arg, "string");
|
|
41
|
+
return typeof key === "symbol" ? key : String(key);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function requestPromise(options) {
|
|
45
|
+
return new Promise(function (res, rej) {
|
|
46
|
+
uni.request(Object.assign(Object.assign({}, options), {
|
|
47
|
+
success: res,
|
|
48
|
+
fail: rej
|
|
49
|
+
}));
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function uploadFilePromise(options) {
|
|
53
|
+
return new Promise(function (res, rej) {
|
|
54
|
+
uni.uploadFile(Object.assign(Object.assign({}, options), {
|
|
55
|
+
success: res,
|
|
56
|
+
fail: rej
|
|
57
|
+
}));
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/** 得到小程序的token */
|
|
61
|
+
function getToken(eventName) {
|
|
62
|
+
return new Promise(function (res, rej) {
|
|
63
|
+
var timeout = setTimeout(rej, 5000);
|
|
64
|
+
uni.sendNativeEvent(eventName, {}, function (resData) {
|
|
65
|
+
clearTimeout(timeout);
|
|
66
|
+
res(resData);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
var UniRequest = /*#__PURE__*/function () {
|
|
71
|
+
function UniRequest(params) {
|
|
72
|
+
var _this = this;
|
|
73
|
+
_classCallCheck(this, UniRequest);
|
|
74
|
+
/** 基准路径 */
|
|
75
|
+
this.baseUrl = '';
|
|
76
|
+
/** 错误处理函数 */
|
|
77
|
+
this.onErrorHandler = function (error) {
|
|
78
|
+
console.error(error);
|
|
79
|
+
};
|
|
80
|
+
this.maxRetryCount = 3;
|
|
81
|
+
/** 超时时间 */
|
|
82
|
+
this.timeout = 10000;
|
|
83
|
+
/** 上传文件的超时时间 */
|
|
84
|
+
this.uploadTimeout = 5000;
|
|
85
|
+
this.retryDelay = 3000;
|
|
86
|
+
this.tokenEventName = 'getToken';
|
|
87
|
+
/** token的header名称,默认Authorization */
|
|
88
|
+
this.tokenHeader = 'Authorization';
|
|
89
|
+
/** 传入的token前缀,默认Bearer ,注意Bearer有个空字符串*/
|
|
90
|
+
this.tokenPrefix = 'Bearer ';
|
|
91
|
+
if (params) {
|
|
92
|
+
Object.keys(params).forEach(function (key) {
|
|
93
|
+
if (params[key] !== void 0) {
|
|
94
|
+
_this[key] = params[key];
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
_createClass(UniRequest, [{
|
|
100
|
+
key: "rejectHandler",
|
|
101
|
+
value: function rejectHandler(rej, data) {
|
|
102
|
+
var _a;
|
|
103
|
+
rej(data);
|
|
104
|
+
(_a = this.onErrorHandler) === null || _a === void 0 ? void 0 : _a.call(this, data);
|
|
105
|
+
}
|
|
106
|
+
}, {
|
|
107
|
+
key: "setParams",
|
|
108
|
+
value: function setParams(params) {
|
|
109
|
+
var _this2 = this;
|
|
110
|
+
if (params) {
|
|
111
|
+
Object.keys(params).forEach(function (key) {
|
|
112
|
+
if (params[key] !== void 0) {
|
|
113
|
+
_this2[key] = params[key];
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}, {
|
|
119
|
+
key: "request",
|
|
120
|
+
value: function request(params) {
|
|
121
|
+
var _this3 = this;
|
|
122
|
+
var callbackPromise = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : requestPromise;
|
|
123
|
+
var url = params.url;
|
|
124
|
+
/** 如果是http开头的,则不需要加入baseUrl */
|
|
125
|
+
if (!/^https?:\/\//.test(url)) {
|
|
126
|
+
url = "".concat(this.baseUrl.replace(/\/$/, ''), "/").concat(params.url.replace(/^\//, ''), "?t=").concat(Date.now());
|
|
127
|
+
} else {
|
|
128
|
+
url = "".concat(params.url, "?t=").concat(Date.now());
|
|
129
|
+
}
|
|
130
|
+
var header = Object.assign(Object.assign({}, this.header), params.header);
|
|
131
|
+
var requestedToken = false;
|
|
132
|
+
var retryCount = 0;
|
|
133
|
+
return new Promise(function (res, rej) {
|
|
134
|
+
var retryFucntion = function retryFucntion() {
|
|
135
|
+
/** 因为token需要动态获取,因此放入这里 */
|
|
136
|
+
// #ifndef H5
|
|
137
|
+
header[_this3.tokenHeader] = "".concat(_this3.tokenPrefix).concat(_this3.token);
|
|
138
|
+
// #endif
|
|
139
|
+
/** 针对h5调试的时候,因为塞入cookie是不安全的,因此无需塞入cookie,使用登录页后,后端塞入的cookie */
|
|
140
|
+
// #ifdef H5
|
|
141
|
+
if (!['cookie'].includes(_this3.tokenHeader)) {
|
|
142
|
+
header[_this3.tokenHeader] = "".concat(_this3.tokenPrefix).concat(_this3.token);
|
|
143
|
+
}
|
|
144
|
+
// #endif
|
|
145
|
+
callbackPromise(Object.assign(Object.assign({}, params), {
|
|
146
|
+
header: header,
|
|
147
|
+
url: url,
|
|
148
|
+
timeout: params.timeout || _this3.timeout
|
|
149
|
+
})).then(function (resData) {
|
|
150
|
+
var statusCode = resData.statusCode,
|
|
151
|
+
data = resData.data;
|
|
152
|
+
if (statusCode === 200) {
|
|
153
|
+
if (!data.errno) {
|
|
154
|
+
res(data.data);
|
|
155
|
+
} else {
|
|
156
|
+
_this3.rejectHandler(rej, resData);
|
|
157
|
+
}
|
|
158
|
+
} else if (statusCode === 403 && !requestedToken) {
|
|
159
|
+
// #ifndef H5
|
|
160
|
+
(_this3.getTokenFun ? _this3.getTokenFun() : getToken(_this3.tokenEventName)).then(function (token) {
|
|
161
|
+
_this3.token = token;
|
|
162
|
+
requestedToken = true;
|
|
163
|
+
/** 获取token应该立马请求,不需要延迟 */
|
|
164
|
+
retryFucntion();
|
|
165
|
+
})["catch"](function () {
|
|
166
|
+
if (_this3.maxRetryCount > retryCount) {
|
|
167
|
+
delayRetryFcuntion();
|
|
168
|
+
} else {
|
|
169
|
+
_this3.rejectHandler(rej, resData);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
// #endif
|
|
173
|
+
// #ifdef H5
|
|
174
|
+
_this3.rejectHandler(rej, resData);
|
|
175
|
+
// #endif
|
|
176
|
+
} else {
|
|
177
|
+
if (_this3.maxRetryCount > retryCount) {
|
|
178
|
+
delayRetryFcuntion();
|
|
179
|
+
} else {
|
|
180
|
+
_this3.rejectHandler(rej, resData);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
})["catch"](function (rejData) {
|
|
184
|
+
if (_this3.maxRetryCount > retryCount) {
|
|
185
|
+
delayRetryFcuntion();
|
|
186
|
+
} else {
|
|
187
|
+
_this3.rejectHandler(rej, rejData);
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
var delayRetryFcuntion = function delayRetryFcuntion() {
|
|
192
|
+
setTimeout(function () {
|
|
193
|
+
retryCount++;
|
|
194
|
+
retryFucntion();
|
|
195
|
+
}, _this3.retryDelay);
|
|
196
|
+
};
|
|
197
|
+
retryFucntion();
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* post请求
|
|
202
|
+
* @param url
|
|
203
|
+
* @param data 可传可不传
|
|
204
|
+
* @param header
|
|
205
|
+
* @returns
|
|
206
|
+
*/
|
|
207
|
+
}, {
|
|
208
|
+
key: "post",
|
|
209
|
+
value: function post(url) {
|
|
210
|
+
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
211
|
+
var header = arguments.length > 2 ? arguments[2] : undefined;
|
|
212
|
+
return this.request({
|
|
213
|
+
url: url,
|
|
214
|
+
data: data,
|
|
215
|
+
header: header,
|
|
216
|
+
method: 'POST'
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
}, {
|
|
220
|
+
key: "get",
|
|
221
|
+
value: function get(url) {
|
|
222
|
+
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
223
|
+
var header = arguments.length > 2 ? arguments[2] : undefined;
|
|
224
|
+
return this.request({
|
|
225
|
+
url: url,
|
|
226
|
+
data: data,
|
|
227
|
+
header: header,
|
|
228
|
+
method: 'GET'
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}, {
|
|
232
|
+
key: "delete",
|
|
233
|
+
value: function _delete(url) {
|
|
234
|
+
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
235
|
+
var header = arguments.length > 2 ? arguments[2] : undefined;
|
|
236
|
+
return this.request({
|
|
237
|
+
url: url,
|
|
238
|
+
data: data,
|
|
239
|
+
header: header,
|
|
240
|
+
method: 'DELETE'
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}, {
|
|
244
|
+
key: "put",
|
|
245
|
+
value: function put(url) {
|
|
246
|
+
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
247
|
+
var header = arguments.length > 2 ? arguments[2] : undefined;
|
|
248
|
+
return this.request({
|
|
249
|
+
url: url,
|
|
250
|
+
data: data,
|
|
251
|
+
header: header,
|
|
252
|
+
method: 'PUT'
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* 文件上传
|
|
257
|
+
* @param url 上传的url
|
|
258
|
+
* @param filePath 文件路径
|
|
259
|
+
* @param formData HTTP 请求中其他额外的 form data
|
|
260
|
+
* @param name 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容,默认key为file
|
|
261
|
+
* @param header
|
|
262
|
+
* @returns
|
|
263
|
+
*/
|
|
264
|
+
}, {
|
|
265
|
+
key: "uploadFile",
|
|
266
|
+
value: function uploadFile(url, filePath, formData) {
|
|
267
|
+
var name = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'file';
|
|
268
|
+
var header = arguments.length > 4 ? arguments[4] : undefined;
|
|
269
|
+
return this.request({
|
|
270
|
+
url: url,
|
|
271
|
+
filePath: filePath,
|
|
272
|
+
formData: formData,
|
|
273
|
+
name: name,
|
|
274
|
+
header: header,
|
|
275
|
+
timeout: this.uploadTimeout,
|
|
276
|
+
method: 'PUT'
|
|
277
|
+
}, uploadFilePromise);
|
|
278
|
+
}
|
|
279
|
+
}]);
|
|
280
|
+
return UniRequest;
|
|
281
|
+
}();
|
|
282
|
+
|
|
283
|
+
exports["default"] = UniRequest;
|
|
284
|
+
|
|
285
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
286
|
+
|
|
287
|
+
}));
|
package/package.json
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uniapp-request-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "用于uniapp小程序的请求库的sdk",
|
|
5
|
-
"main": "dist/index.
|
|
5
|
+
"main": "dist/index.umd.js",
|
|
6
|
+
"module": " dist/index.esm.js",
|
|
6
7
|
"typings": "dist/index.d.ts",
|
|
7
8
|
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"require": "./dist/index.umd.js",
|
|
12
|
+
"import": "./dist/index.esm.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
8
15
|
"files": [
|
|
9
16
|
"dist"
|
|
10
17
|
],
|
|
@@ -50,5 +57,12 @@
|
|
|
50
57
|
"rollup-plugin-terser": "^7.0.2",
|
|
51
58
|
"rollup-plugin-typescript2": "^0.27.2",
|
|
52
59
|
"typescript": "^4.0.2"
|
|
60
|
+
},
|
|
61
|
+
"buildOptions": {
|
|
62
|
+
"name": "UniappRequestSdk",
|
|
63
|
+
"formats": [
|
|
64
|
+
"umd",
|
|
65
|
+
"esm"
|
|
66
|
+
]
|
|
53
67
|
}
|
|
54
68
|
}
|