mirror of
https://github.com/imdap/ruoyi-plus-vben5.git
synced 2026-05-13 06:42:10 +08:00
refactor: 迁移requestClient到alovaInstance并移除旧版上传组件
重构项目中所有使用requestClient的API调用,替换为alovaInstance 移除已废弃的旧版上传组件及相关代码 调整上传组件类型定义以适配antdv-next更新 优化上传逻辑,移除不必要的进度事件和取消信号 更新类型定义文件,迁移axios配置到alova类型
This commit is contained in:
@@ -2,7 +2,7 @@ import type { Notice } from './model';
|
||||
|
||||
import type { ID, IDS, PageQuery } from '#/api/common';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
import { alovaInstance } from '#/utils/http';
|
||||
|
||||
enum Api {
|
||||
noticeList = '/system/notice/list',
|
||||
@@ -15,7 +15,7 @@ enum Api {
|
||||
* @returns 分页结果
|
||||
*/
|
||||
export function noticeList(params?: PageQuery) {
|
||||
return requestClient.get<Notice[]>(Api.noticeList, { params });
|
||||
return alovaInstance.get<Notice[]>(Api.noticeList, { params });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -24,7 +24,7 @@ export function noticeList(params?: PageQuery) {
|
||||
* @returns 详情
|
||||
*/
|
||||
export function noticeInfo(noticeId: ID) {
|
||||
return requestClient.get<Notice>(`${Api.root}/${noticeId}`);
|
||||
return alovaInstance.get<Notice>(`${Api.root}/${noticeId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,7 +32,7 @@ export function noticeInfo(noticeId: ID) {
|
||||
* @param data 参数
|
||||
*/
|
||||
export function noticeAdd(data: Partial<Notice>) {
|
||||
return requestClient.postWithMsg<void>(Api.root, data);
|
||||
return alovaInstance.postWithMsg<void>(Api.root, data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -40,7 +40,7 @@ export function noticeAdd(data: Partial<Notice>) {
|
||||
* @param data 参数
|
||||
*/
|
||||
export function noticeUpdate(data: any) {
|
||||
return requestClient.putWithMsg<void>(Api.root, data);
|
||||
return alovaInstance.putWithMsg<void>(Api.root, data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,5 +48,5 @@ export function noticeUpdate(data: any) {
|
||||
* @param noticeIds ids
|
||||
*/
|
||||
export function noticeRemove(noticeIds: IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`${Api.root}/${noticeIds}`);
|
||||
return alovaInstance.deleteWithMsg<void>(`${Api.root}/${noticeIds}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user