Refactor build and start scripts in package.json; add plugin to exclude debug files from production build in vite.config.ts; remove ConnectScreen component and replace with ConnectionPlaceholder in multiple pages; update DeviceContext to auto-connect using device IP from URL; enhance locale files with new device IP labels.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
/** 从地址栏 ?ip= 读取设备 IP(hash 路由下 query 仍在 search 上) */
|
||||
export function getDeviceIpFromUrl(): string | null {
|
||||
if (typeof window === "undefined") return null;
|
||||
const ip = new URLSearchParams(window.location.search).get("ip");
|
||||
const trimmed = ip?.trim();
|
||||
return trimmed || null;
|
||||
}
|
||||
|
||||
export function resolveInitialDeviceIp(): string {
|
||||
return getDeviceIpFromUrl() ?? localStorage.getItem("luxsin_ip") ?? "192.168.2.30";
|
||||
}
|
||||
Reference in New Issue
Block a user