Files
juip-web/src/components/stores/app.ts

12 lines
362 B
TypeScript
Raw Normal View History

2026-09-04 13:21:47 +08:00
import { create } from "zustand"
import { API_BASE_URL } from "@/lib/api"
// ==================== 应用配置 ====================
// 后端地址等运行时配置统一从 store 读取,初始值来自 import.meta.env(见 lib/api.ts)
type AppState = {
apiUrl: string
}
export const useAppStore = create<AppState>()(() => ({ apiUrl: API_BASE_URL }))