From 0fbabebb3d29b6bc4a32ecd50b1f77814949507b Mon Sep 17 00:00:00 2001 From: DCloud_LXH <283700113@qq.com> Date: Mon, 27 Sep 2021 19:00:00 +0800 Subject: [PATCH] chore: uni.interceptors --- packages/uni-api/src/service/base/interceptor.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/uni-api/src/service/base/interceptor.ts b/packages/uni-api/src/service/base/interceptor.ts index b9d39d73e..998da7ef3 100644 --- a/packages/uni-api/src/service/base/interceptor.ts +++ b/packages/uni-api/src/service/base/interceptor.ts @@ -113,7 +113,7 @@ export const removeInterceptor = defineSyncApi( RemoveInterceptorProtocol ) -export const promiseInterceptor = { +const promiseInterceptor = { returnValue(res: unknown) { if (!isPromise(res)) { return res @@ -129,3 +129,7 @@ export const promiseInterceptor = { }) }, } + +export const interceptors = { + promiseInterceptor, +} -- GitLab