fix: 修复菜单 mock 组件死链,补齐应用/配置/代码生成/文件模块 mock 接口

This commit is contained in:
Ray.Hao
2026-08-12 14:56:45 +08:00
parent e1aa8fc2a1
commit 1965641229
5 changed files with 670 additions and 1 deletions

33
mock/file.mock.ts Normal file
View File

@@ -0,0 +1,33 @@
import { defineMock } from "./base";
export default defineMock([
// 上传文件
{
url: "files",
method: ["POST"],
body() {
const name = `mock-upload-${Date.now()}.png`;
return {
code: "00000",
data: {
name,
url: "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
},
msg: "上传成功",
};
},
},
// 删除文件
{
url: "files",
method: ["DELETE"],
body({ query }) {
return {
code: "00000",
data: null,
msg: query.filePath ? `删除文件 ${query.filePath} 成功` : "删除成功",
};
},
},
]);