fix:css&&select

This commit is contained in:
dichgrem
2026-01-07 13:31:51 +08:00
parent e3879623a9
commit 876063e3cf
5 changed files with 74 additions and 37 deletions

View File

@@ -148,8 +148,32 @@ function mockPlugin() {
req.method === "GET"
)
return sendJSON("yearScore.json");
if (pathname.startsWith("/api/service/list") && req.method === "GET")
return sendJSON("serviceList.json");
if (pathname.startsWith("/api/service/list") && req.method === "GET") {
const sl = readJson("serviceList.json", {
error: 0,
data: { current: 1, pageSize: 10, pageCount: 1, list: [] },
});
const url = new URL(req.url, `http://${req.headers.host}`);
const year = url.searchParams.get("year");
let list = sl.data?.list || [];
if (year && year !== "all") {
const yearNum = Number(year);
list = list.filter((item) => {
const date = new Date(item.time);
return date.getFullYear() === yearNum;
});
}
const result = {
error: 0,
data: {
...sl.data,
list,
current: 1,
pageCount: 1,
},
};
return send(res, result);
}
if (pathname.startsWith("/api/service/details") && req.method === "GET")
return sendJSON("recordDetails.json");