fix: 修复API请求方法和参数处理,优化路由组件解析逻辑

- 将`updateAnchor`方法的请求方式改为PUT,`deleteAnchor`方法改为DELETE并使用params传递数据
- 在路由组件中添加`normalizeRouteComponent`和`resolveRouteComponent`函数,增强动态路由解析能力
- 更新多个组件中的ID处理逻辑,确保ID始终为字符串类型
- 修改样式以统一选择框的宽度
This commit is contained in:
2026-04-21 17:52:06 +08:00
parent 4271e7d2d9
commit 038e4d72d3
2 changed files with 355 additions and 0 deletions

View File

@@ -0,0 +1,77 @@
import request from '/@/utils/request';
export interface CreationListParams {
pageNum: number;
pageSize: number;
keyword?: string;
}
export interface CreationTitleItem {
title: string;
htmlFileUrl: string;
jsonFileUrl: string[];
}
export interface CreationThemeItem {
theme: string;
titles: CreationTitleItem[];
}
export interface CreationTreeItem {
createdDate: string;
themes: CreationThemeItem[];
}
export interface CreationListData {
list: unknown[] | null;
total: number;
Tree: CreationTreeItem[];
imgAddressPrefix: string;
}
export interface CreationListResponse {
code: number;
message: string;
data: CreationListData;
}
export interface CreationSubmitParams {
mode: string;
content_type: string;
theme: string;
title: string;
description?: string;
style: string;
count: number;
image_per_post: number;
image_ratio: string;
}
export interface DownloadToFileParams {
fileURL: string;
localPath: string;
}
export function getCreationList(params: CreationListParams) {
return request({
url: '/black-deacon/creation/info/list',
method: 'get',
params,
}) as Promise<CreationListResponse>;
}
export function createCreation(data: CreationSubmitParams) {
return request({
url: '/black-deacon/creation/info/creation',
method: 'post',
data,
});
}
export function downloadToFile(data: DownloadToFileParams) {
return request({
url: '/oss/file/downloadToFile',
method: 'post',
data,
});
}