mirror of
https://gitee.com/dapppp/ruoyi-plus-vben5.git
synced 2026-03-27 03:33:22 +08:00
refactor: 迁移requestClient到alovaInstance并移除旧版上传组件
重构项目中所有使用requestClient的API调用,替换为alovaInstance 移除已废弃的旧版上传组件及相关代码 调整上传组件类型定义以适配antdv-next更新 优化上传逻辑,移除不必要的进度事件和取消信号 更新类型定义文件,迁移axios配置到alova类型
This commit is contained in:
63
apps/web-antd/types/alova.d.ts
vendored
63
apps/web-antd/types/alova.d.ts
vendored
@@ -13,32 +13,11 @@ type PostType = AlovaInstanceType['Post'];
|
||||
type PutType = AlovaInstanceType['Put'];
|
||||
type DeleteType = AlovaInstanceType['Delete'];
|
||||
|
||||
export type AlovaMeta = {
|
||||
/**
|
||||
* 是否需要对请求体进行加密
|
||||
*/
|
||||
encrypt?: boolean;
|
||||
/**
|
||||
* 错误弹窗类型
|
||||
*/
|
||||
errorMessageMode?: MessageType;
|
||||
/**
|
||||
* 是否返回原生axios响应
|
||||
*/
|
||||
isReturnNativeResponse?: boolean;
|
||||
/**
|
||||
* 是否需要转换响应 即只获取{code, msg, data}中的data
|
||||
*/
|
||||
isTransformResponse?: boolean;
|
||||
/**
|
||||
* 接口请求成功时的提示方式
|
||||
*/
|
||||
successMessageMode?: MessageType;
|
||||
/**
|
||||
* 是否需要在请求头中添加 token
|
||||
*/
|
||||
withToken?: boolean;
|
||||
};
|
||||
/**
|
||||
* 拓展自己的Meta
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
export type AlovaMeta = {};
|
||||
|
||||
declare module 'alova' {
|
||||
export interface AlovaCustomTypes {
|
||||
@@ -61,4 +40,36 @@ declare module 'alova' {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 拓展axios的请求配置
|
||||
*/
|
||||
declare module 'axios' {
|
||||
interface AxiosRequestConfig {
|
||||
/**
|
||||
* 是否需要对请求体进行加密
|
||||
*/
|
||||
encrypt?: boolean;
|
||||
/**
|
||||
* 错误弹窗类型
|
||||
*/
|
||||
errorMessageMode?: MessageType;
|
||||
/**
|
||||
* 是否返回原生axios响应
|
||||
*/
|
||||
isReturnNativeResponse?: boolean;
|
||||
/**
|
||||
* 是否需要转换响应 即只获取{code, msg, data}中的data
|
||||
*/
|
||||
isTransformResponse?: boolean;
|
||||
/**
|
||||
* 接口请求成功时的提示方式
|
||||
*/
|
||||
successMessageMode?: MessageType;
|
||||
/**
|
||||
* 是否需要在请求头中添加 token
|
||||
*/
|
||||
withToken?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
|
||||
Reference in New Issue
Block a user