chore: 同步园区大屏改动(config/main)及审查问题分布报告
This commit is contained in:
+5
-2
@@ -5,7 +5,7 @@ import BindScreen from "./components/BindScreen.jsx";
|
||||
import { isDeviceBound } from "./utils/tenant";
|
||||
import ErrorBoundary from "./components/ErrorBoundary";
|
||||
import { ThemeProvider } from "@appica/ui-react/providers/theme-provider";
|
||||
import { getApiBase, getMqttUrl, getMqttCredentials } from "./config";
|
||||
import { getApiBase, getMqttUrl, getMqttCredentials, PARK_BOOTSTRAP_TOKEN } from "./config";
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import "./styles/global.css";
|
||||
|
||||
@@ -62,7 +62,10 @@ async function bootstrapRuntimeConfig() {
|
||||
// 则后端 /api/config 不再覆盖(避免后端默认 localhost 冲掉正确地址)。
|
||||
const bakedMqtt = import.meta.env.VITE_MQTT_URL;
|
||||
try {
|
||||
const res = await fetch(`${getApiBase()}/api/config`, { cache: 'no-store' });
|
||||
const res = await fetch(`${getApiBase()}/api/config`, {
|
||||
cache: 'no-store',
|
||||
headers: PARK_BOOTSTRAP_TOKEN ? { 'X-Park-Bootstrap': PARK_BOOTSTRAP_TOKEN } : undefined,
|
||||
});
|
||||
if (res.ok) {
|
||||
const cfg = await res.json();
|
||||
if (!bakedMqtt && cfg.mqtt_url) window.__DPM_MQTT__ = cfg.mqtt_url;
|
||||
|
||||
Reference in New Issue
Block a user