From bc8faed83ab1721e51b936472975aed4dbc5ffdc Mon Sep 17 00:00:00 2001 From: winixt Date: Tue, 15 Nov 2022 15:30:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20request=20ts=20?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=8F=90=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fes-plugin-request/types.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/fes-plugin-request/types.d.ts b/packages/fes-plugin-request/types.d.ts index 1d3c2526..d7bb4176 100644 --- a/packages/fes-plugin-request/types.d.ts +++ b/packages/fes-plugin-request/types.d.ts @@ -7,14 +7,16 @@ type ResponseInterceptor = (value: AxiosResponse) => AxiosResponse | [(value: Ax interface RequestPluginOption { mergeRequest?: boolean; + dataHandler?(data: any, response: AxiosResponse): any; + errorHandler?(error: AxiosError | {type: string, msg: string, [key: string]: string}): void; cache?: boolean | { type: 'ram' | 'sessionStorage' | 'localStorage', cacheTime: number; } } -export function request(url: string, data: null | Record, options: AxiosRequestConfig & RequestPluginOption ): Promise -export function useRequest(url: string, data: null | Record, options: AxiosRequestConfig & RequestPluginOption ): {loadingRef: Ref; errorRef: Ref; dataRef: Ref} +export function request(url: string, data?: null | Record, options?: AxiosRequestConfig & RequestPluginOption ): Promise +export function useRequest(url: string, data?: null | Record, options?: AxiosRequestConfig & RequestPluginOption ): {loadingRef: Ref; errorRef: Ref; dataRef: Ref} declare module "@fesjs/fes" { interface PluginRuntimeConfig { request?: { From 02c26e4a9d5d8e2e1f8de5b61a3c4e3ef427b21a Mon Sep 17 00:00:00 2001 From: winixt Date: Tue, 15 Nov 2022 15:30:49 +0800 Subject: [PATCH 2/2] chore: v3.0.0-beta.32 --- CHANGELOG.md | 9 +++++++++ package.json | 2 +- packages/fes-plugin-request/package.json | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e26ce21b..5f6384da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# [3.0.0-beta.32](https://github.com/WeBankFinTech/fes.js/compare/v3.0.0-beta.31...v3.0.0-beta.32) (2022-11-15) + + +### Bug Fixes + +* 修复 request ts 类型提示问题 ([2469009](https://github.com/WeBankFinTech/fes.js/commit/246900923a71b872cda37003c08fae3046d250d9)) + + + # [3.0.0-beta.31](https://github.com/WeBankFinTech/fes.js/compare/v3.0.0-beta.29...v3.0.0-beta.31) (2022-11-10) diff --git a/package.json b/package.json index 1844ac36..bb4fb15d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fes.js", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "一个好用的前端管理台快速开发框架", "preferGlobal": true, "private": true, diff --git a/packages/fes-plugin-request/package.json b/packages/fes-plugin-request/package.json index ae5ee311..9934f01b 100644 --- a/packages/fes-plugin-request/package.json +++ b/packages/fes-plugin-request/package.json @@ -1,6 +1,6 @@ { "name": "@fesjs/plugin-request", - "version": "3.0.0-rc.1", + "version": "3.0.0-rc.2", "description": "@fesjs/plugin-request", "main": "lib/index.js", "files": [