fix: 更新API请求方法和参数处理,优化路由组件解析逻辑
- 将`updateAnchor`方法的请求方式改为PUT,`deleteAnchor`方法改为DELETE并使用params传递数据 - 在路由组件中添加`normalizeRouteComponent`和`resolveRouteComponent`函数,增强动态路由解析能力 - 更新多个组件中的ID处理逻辑,确保ID始终为字符串类型 - 修改样式以统一选择框的宽度
This commit is contained in:
88
src/api/trade/operation/setting/live-account/index.ts
Normal file
88
src/api/trade/operation/setting/live-account/index.ts
Normal file
@@ -0,0 +1,88 @@
|
||||
import request from '/@/utils/request';
|
||||
|
||||
export interface LiveAccountParams {
|
||||
pageNum: number;
|
||||
pageSize: number;
|
||||
platform?: string;
|
||||
accountName?: string;
|
||||
accountId?: string;
|
||||
status?: number;
|
||||
}
|
||||
|
||||
export interface LiveAccountSaveParams {
|
||||
id?: string;
|
||||
platform: string;
|
||||
accountName: string;
|
||||
accountId: string;
|
||||
status?: number;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface LiveAccount {
|
||||
id: string;
|
||||
platform: string;
|
||||
accountName: string;
|
||||
accountId: string;
|
||||
status: number;
|
||||
statusName: string;
|
||||
remark: string;
|
||||
createdAt: number;
|
||||
updatedAt: number;
|
||||
}
|
||||
|
||||
export interface LiveAccountListResult {
|
||||
list: LiveAccount[];
|
||||
total: number;
|
||||
}
|
||||
|
||||
export interface LiveAccountListResponse {
|
||||
code: number;
|
||||
message: string;
|
||||
data: LiveAccountListResult;
|
||||
}
|
||||
|
||||
export interface LiveAccountDetailResponse {
|
||||
code: number;
|
||||
message: string;
|
||||
data: LiveAccount;
|
||||
}
|
||||
|
||||
export function getLiveAccountList(params: LiveAccountParams): Promise<LiveAccountListResponse> {
|
||||
return request({
|
||||
url: '/erp/live/account/controller/listLiveAccounts',
|
||||
method: 'get',
|
||||
params,
|
||||
}) as Promise<LiveAccountListResponse>;
|
||||
}
|
||||
|
||||
export function getLiveAccountDetail(params: { id: string }): Promise<LiveAccountDetailResponse> {
|
||||
return request({
|
||||
url: '/erp/live/account/controller/getLiveAccount',
|
||||
method: 'get',
|
||||
params,
|
||||
}) as Promise<LiveAccountDetailResponse>;
|
||||
}
|
||||
|
||||
export function createLiveAccount(data: LiveAccountSaveParams) {
|
||||
return request({
|
||||
url: '/erp/live/account/controller/createLiveAccount',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export function updateLiveAccount(data: LiveAccountSaveParams) {
|
||||
return request({
|
||||
url: '/erp/live/account/controller/updateLiveAccount',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export function deleteLiveAccount(params: { id: string }) {
|
||||
return request({
|
||||
url: '/erp/live/account/controller/deleteLiveAccount',
|
||||
method: 'delete',
|
||||
params,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user