- 新增 React + TDesign 管理端(sau_web_react),替代历史 Vue 前端 - 后端接入 11 平台登录/发布(视频+图文),check_cookie 扩展全平台 - 异步发布任务 + 实时进度监控 + 发布日志 - Open API 开放体系(API Key 鉴权 + 7 个开放接口 + API 文档页) - 账号单/批量校验与批量删除 - 全局配置(登录方式 + 发布静默模式) - 统一浏览器为系统 Chrome,品牌文案统一为 EveryPublish
26 lines
711 B
TypeScript
26 lines
711 B
TypeScript
import request from 'utils/request';
|
|
|
|
export interface IMaterial {
|
|
id: number;
|
|
filename: string;
|
|
filesize: number;
|
|
upload_time: string;
|
|
file_path: string;
|
|
uuid: string;
|
|
}
|
|
|
|
export const getMaterials = async (): Promise<IMaterial[]> => {
|
|
const result: any = await request.get('/api/getFiles');
|
|
return result?.data || [];
|
|
};
|
|
|
|
export const uploadMaterial = (formData: FormData) =>
|
|
request.post('/api/uploadSave', formData, {
|
|
headers: { 'Content-Type': 'multipart/form-data' },
|
|
timeout: 0,
|
|
});
|
|
|
|
export const deleteMaterial = (id: number) => request.get('/api/deleteFile?id=' + id);
|
|
|
|
export const getFileUrl = (filename: string) => '/api/getFile?filename=' + encodeURIComponent(filename);
|