fix(proxy): check if proxy port is in use #5891

This commit is contained in:
Tunglies
2025-12-20 19:11:27 +08:00
parent 5afe11e55b
commit 16c3dcc616
21 changed files with 103 additions and 11 deletions
+9
View File
@@ -554,3 +554,12 @@ export const isAdmin = async () => {
export async function getNextUpdateTime(uid: string) {
return invoke<number | null>("get_next_update_time", { uid });
}
export const isPortInUse = async (port: number) => {
try {
return await invoke<boolean>("is_port_in_use", { port });
} catch (error) {
console.error("检查端口使用状态失败:", error);
return false;
}
};