fix: close business flow regressions

This commit is contained in:
david
2026-07-31 11:33:28 +08:00
parent 42a2322c8e
commit a47e9025d0
18 changed files with 403 additions and 30 deletions

View File

@@ -1,12 +1,12 @@
/** 配送点后台 HTTP 客户端,使用独立 API 前缀和 JWT 存储键。 */
const apiBaseURL = import.meta.env.VITE_API_BASE_URL || 'http://localhost:12426/heqi/delivery/v1';
import { getToken } from '@/utils/auth';
export const tokenStorageKey = 'delivery_admin_token';
const apiBaseURL = import.meta.env.VITE_API_BASE_URL || 'http://localhost:12426/heqi/delivery/v1';
export type PageResult<T> = { total: number; list: T[] };
export async function request<T>(path: string, init?: RequestInit): Promise<T> {
const token = localStorage.getItem(tokenStorageKey);
const token = getToken();
let response: Response;
try {
response = await fetch(`${apiBaseURL}${path}`, {