utils-uniapp 1.1.26 → 1.1.28

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.
@@ -286,7 +286,7 @@ export interface UserRequestOpts {
286
286
  loading?: boolean;
287
287
  /**
288
288
  * 请求前置拦截器
289
- * - 支持单个拦截器函数 / 拦截器函数数组,多个拦截器按顺序链式执行
289
+ * - 支持单个拦截器函数 / 拦截器函数数组,多个拦截器按顺序链式执行,支持异步函数
290
290
  * - 拦截器返回 null / undefined 时,自动沿用原始 invokeArgs
291
291
  * @param ctx 上下文
292
292
  * @param ctx.invokeArgs 组装完成即将传给uni的请求参数
@@ -297,7 +297,7 @@ export interface UserRequestOpts {
297
297
  reqInterceptor?: UserReqInterceptor;
298
298
  /**
299
299
  * 响应拦截器
300
- * - 支持单个拦截器函数 / 拦截器函数数组,多个拦截器按顺序链式执行
300
+ * - 支持单个拦截器函数 / 拦截器函数数组,多个拦截器按顺序链式执行,支持异步函数
301
301
  * - 拦截器返回 null / undefined 时,自动沿用原始响应res
302
302
  * @param ctx 上下文
303
303
  * @param ctx.res uni原始响应对象
@@ -310,7 +310,7 @@ export interface UserRequestOpts {
310
310
  resInterceptor?: UserResInterceptor;
311
311
  /**
312
312
  * 错误拦截器
313
- * - 支持单个拦截器函数 / 拦截器函数数组,多个拦截器按顺序链式执行
313
+ * - 支持单个拦截器函数 / 拦截器函数数组,多个拦截器按顺序链式执行,支持异步函数
314
314
  * - 拦截器返回 null / undefined 时,自动抛出原始err
315
315
  * @param ctx 上下文
316
316
  * @param ctx.err 捕获到的异常对象(RequestFailPayload | Error)
@@ -345,7 +345,7 @@ export type RuntimeHeadersCtx<T = {}> = {
345
345
  export type HttpRequestConfig = Partial<Omit<UniApp.RequestOptions, 'url' | 'header' | 'method' | 'data' | 'cancelToken'>> & {
346
346
  /** 库自定义:请求基础地址,非uni.request原生参数 */
347
347
  baseURL?: string;
348
- /** 库自定义:headers支持对象或者返回对象的工厂函数 */
348
+ /** 库自定义:headers支持对象或者返回对象的工厂函数(同步/异步) */
349
349
  headers?: Record<string, string> | ((ctx: RuntimeHeadersCtx<HttpRequestConfig>) => Record<string, string> | Promise<Record<string, string>>);
350
350
  /** 自定义扩展字段 */
351
351
  [key: string]: any;
@@ -358,7 +358,7 @@ export type HttpRequestConfig = Partial<Omit<UniApp.RequestOptions, 'url' | 'hea
358
358
  export type UploadConfig = Partial<Omit<UniApp.UploadFileOption, 'url' | 'header' | 'filePath' | 'name' | 'formData' | 'cancelToken'>> & {
359
359
  /** 库自定义:请求基础地址 */
360
360
  baseURL?: string;
361
- /** 库自定义:headers支持对象或者返回对象的工厂函数 */
361
+ /** 库自定义:headers支持对象或者返回对象的工厂函数(同步/异步) */
362
362
  headers?: Record<string, string> | ((ctx: RuntimeHeadersCtx<UploadConfig>) => Record<string, string> | Promise<Record<string, string>>);
363
363
  /** 自定义扩展字段 */
364
364
  [key: string]: any;
@@ -371,7 +371,7 @@ export type UploadConfig = Partial<Omit<UniApp.UploadFileOption, 'url' | 'header
371
371
  export type DownloadConfig = Partial<Omit<UniApp.DownloadFileOption, 'url' | 'header' | 'cancelToken'>> & {
372
372
  /** 库自定义:请求基础地址 */
373
373
  baseURL?: string;
374
- /** 库自定义:headers支持对象或者返回对象的工厂函数 */
374
+ /** 库自定义:headers支持对象或者返回对象的工厂函数(同步/异步) */
375
375
  headers?: Record<string, string> | ((ctx: RuntimeHeadersCtx<DownloadConfig>) => Record<string, string> | Promise<Record<string, string>>);
376
376
  /** 自定义扩展字段 */
377
377
  [key: string]: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utils-uniapp",
3
- "version": "1.1.26",
3
+ "version": "1.1.28",
4
4
  "description": "aubyn's utils for uniapp",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",