Compare commits

..

1 Commits

Author SHA1 Message Date
xiaoxian521
c31f9245ed refactor: 重构API接口响应格式,带来简洁高效的接口设计 2025-12-17 11:03:45 +08:00
6 changed files with 469 additions and 709 deletions

View File

@@ -6,7 +6,8 @@ export default defineFakeRoute([
method: "post",
response: () => {
return {
success: true,
code: 0,
message: "操作成功",
data: {
list: [
{

View File

@@ -97,7 +97,7 @@
"vditor": "^3.11.2",
"version-rocket": "^1.7.4",
"vue": "^3.5.25",
"vue-i18n": "https://pkg.pr.new/vue-i18n@2337",
"vue-i18n": "^11.2.2",
"vue-json-pretty": "^2.6.0",
"vue-pdf-embed": "^2.1.3",
"vue-router": "^4.6.3",
@@ -164,7 +164,7 @@
"typescript": "^5.9.3",
"typescript-eslint": "^8.49.0",
"unplugin-icons": "^22.5.0",
"vite": "8.0.0-beta.3",
"vite": "^7.2.7",
"vite-plugin-cdn-import": "^1.0.1",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-fake-server": "^2.2.2",

1148
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,8 @@
import { http } from "@/utils/http";
type Result = {
success: boolean;
code: number;
message: string;
data?: {
/** 列表数据 */
list: Array<any>;

View File

@@ -38,12 +38,14 @@ const dataLoading = ref(true);
const getCardListData = async () => {
try {
const { data } = await getCardList();
productList.value = data.list;
pagination.value = {
...pagination.value,
total: data.list.length
};
const { code, data } = await getCardList();
if (code === 0) {
productList.value = data.list;
pagination.value = {
...pagination.value,
total: data.list.length
};
}
} catch (e) {
console.log(e);
} finally {

View File

@@ -42,7 +42,7 @@ export default ({ mode }: ConfigEnv): UserConfigExport => {
sourcemap: false,
// 消除打包大小超过500kb警告
chunkSizeWarningLimit: 4000,
rolldownOptions: {
rollupOptions: {
input: {
index: pathResolve("./index.html", import.meta.url)
},
@@ -51,10 +51,6 @@ export default ({ mode }: ConfigEnv): UserConfigExport => {
chunkFileNames: "static/js/[name]-[hash].js",
entryFileNames: "static/js/[name]-[hash].js",
assetFileNames: "static/[ext]/[name]-[hash].[ext]"
},
checks: {
// 禁用插件计时警告
pluginTimings: false
}
}
},