Files
juip-web/src/components/stores/app.ts
2026-09-04 16:52:53 +08:00

12 lines
362 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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 }))