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": [ 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?: {