refactor: 重构API接口响应格式,带来简洁高效的接口设计 (#1256)

This commit is contained in:
xiaoming
2026-01-10 08:58:20 +08:00
committed by GitHub
parent ebc92ba61c
commit f2616fdfaf
30 changed files with 210 additions and 131 deletions

View File

@@ -8,7 +8,8 @@ export default defineFakeRoute([
response: ({ body }) => {
if (body.username === "admin") {
return {
success: true,
code: 0,
message: "操作成功",
data: {
avatar: "https://avatars.githubusercontent.com/u/44761321",
username: "admin",
@@ -24,7 +25,8 @@ export default defineFakeRoute([
};
} else {
return {
success: true,
code: 0,
message: "操作成功",
data: {
avatar: "https://avatars.githubusercontent.com/u/52823142",
username: "common",