e022146c51
- vite: 增 /park/tenants、/park/auth 代理键(此前仅 /park/api,/park/tenants 被当作 SPA 返回 HTML→JSON 解析失败→界面空白/无反应)。 - park.ts/types: 增 screens CRUD(按 tenant) + ParkScreen。 - 新增 screens-tab(屏幕管理):登记本园区大屏设备(device_id/name/role/location)+删除;腾换 index 的“配置/建园区”为“屏幕管理”。 (“创建园区”改为运营端平台功能,见下一步园区账密登录的园区端视图建设。)
33 lines
1.3 KiB
TypeScript
33 lines
1.3 KiB
TypeScript
import { defineConfig, loadEnv } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import { fileURLToPath, URL } from "node:url";
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const rootDir = fileURLToPath(new URL(".", import.meta.url));
|
|
const env = loadEnv(mode, rootDir, "");
|
|
|
|
return {
|
|
plugins: [react(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
|
},
|
|
},
|
|
base: env.VITE_BASE_PATH || "/",
|
|
server: {
|
|
port: 5175,
|
|
proxy: {
|
|
// 开发期把 /api 与 /auth、/admin 代理到 server-core,避免跨域
|
|
"/api": { target: env.VITE_API_PROXY || "http://127.0.0.1:8090", changeOrigin: true },
|
|
"/auth": { target: env.VITE_API_PROXY || "http://127.0.0.1:8090", changeOrigin: true },
|
|
"/admin": { target: env.VITE_API_PROXY || "http://127.0.0.1:8090", changeOrigin: true },
|
|
// 园区 SaaS API 子路径(勿代理 SPA 路由 /park 本身,否则刷新 404)
|
|
"/park/api": { target: env.VITE_API_PROXY || "http://127.0.0.1:8090", changeOrigin: true },
|
|
"/park/tenants": { target: env.VITE_API_PROXY || "http://127.0.0.1:8090", changeOrigin: true },
|
|
"/park/auth": { target: env.VITE_API_PROXY || "http://127.0.0.1:8090", changeOrigin: true },
|
|
},
|
|
},
|
|
};
|
|
});
|