feat: 建立前端 TS 类型系统与 API 请求服务层

This commit is contained in:
2026-08-04 17:09:55 +08:00
parent daae052878
commit d18d9dbaac
6 changed files with 162 additions and 0 deletions

View File

@ -0,0 +1,10 @@
import api from "./api";
import type { ProductScanResponse } from "../types/api";
/** 扫码查询 — 根据 16 位序列号查产品 + 顶层任务 */
export async function scanProduct(serialNumber: string): Promise<ProductScanResponse> {
const { data } = await api.get<ProductScanResponse>(
`/products/scan/${encodeURIComponent(serialNumber)}`
);
return data;
}