From cecd74df311a45e379562d77a8b54d25e00d1d6d Mon Sep 17 00:00:00 2001 From: qiang Date: Mon, 21 Jun 2021 19:49:58 +0800 Subject: [PATCH] fix(types): defineAsyncApi errMsg --- packages/uni-api/src/helpers/api/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/uni-api/src/helpers/api/index.ts b/packages/uni-api/src/helpers/api/index.ts index 065fdec12..d28b8cd53 100644 --- a/packages/uni-api/src/helpers/api/index.ts +++ b/packages/uni-api/src/helpers/api/index.ts @@ -52,7 +52,7 @@ function invokeSuccess(id: number, name: string, res: unknown) { return invokeCallback(id, extend(res || {}, { errMsg: name + ':ok' })) } -function invokeFail(id: number, name: string, errMsg: string, errRes?: any) { +function invokeFail(id: number, name: string, errMsg?: string, errRes?: any) { return invokeCallback( id, Object.assign( @@ -230,7 +230,7 @@ export function defineAsyncApi>( args: Omit, res: { resolve: (res?: AsyncApiRes

) => void - reject: (errMsg: string, errRes?: any) => void + reject: (errMsg?: string, errRes?: any) => void } ) => void, protocol?: ApiProtocols, -- GitLab