mirror of
https://github.com/EasyTier/EasytierGame.git
synced 2025-05-19 10:27:56 +00:00
修复winIp无法自启的bug
This commit is contained in:
@@ -9,10 +9,8 @@ const getWinIpBroadcastPid = async () => {
|
||||
mainStore.winipBcPid = (pid as number) || 0;
|
||||
if (mainStore.winipBcPid && mainStore.winipBcPid > 0) {
|
||||
mainStore.winipBcStart = true;
|
||||
mainStore.winIpBcAutoStart = true;
|
||||
} else {
|
||||
mainStore.winipBcStart = false;
|
||||
mainStore.winIpBcAutoStart = false;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -25,6 +23,7 @@ export const handleWinipBcStart = async () => {
|
||||
mainStore.winipBcPid = child.pid || 0;
|
||||
if (mainStore.winipBcPid) {
|
||||
mainStore.winipBcStart = true;
|
||||
mainStore.winIpBcAutoStart = true;
|
||||
} else {
|
||||
ElMessage.error(`启动失败`);
|
||||
}
|
||||
@@ -33,6 +32,7 @@ export const handleWinipBcStart = async () => {
|
||||
console.log(err);
|
||||
}
|
||||
} else {
|
||||
mainStore.winIpBcAutoStart = false;
|
||||
await invoke("stop_command", { child_id: mainStore.winipBcPid || 0 });
|
||||
await getWinIpBroadcastPid();
|
||||
}
|
||||
@@ -42,7 +42,7 @@ export const initStartWinIpBroadcast = async () => {
|
||||
const mainStore = useMainStore();
|
||||
await getWinIpBroadcastPid();
|
||||
// console.log(mainStore.winipBcStart, mainStore.winIpBcAutoStart)
|
||||
if (!mainStore.winipBcStart && mainStore.winIpBcAutoStart) {
|
||||
if (mainStore.winIpBcAutoStart && !mainStore.winipBcStart) {
|
||||
await handleWinipBcStart();
|
||||
}
|
||||
};
|
||||
+1
-1
@@ -314,7 +314,7 @@
|
||||
const appWindow = getCurrentWindow();
|
||||
mainStore.$subscribe((...a) => {
|
||||
// console.log("subscribe", a);
|
||||
appWindow.emitTo("main", "config", { winIpBcAutoStart: mainStore.winIpBcAutoStart });
|
||||
appWindow.emitTo("main", "config", { winIpBcAutoStart: mainStore.winIpBcAutoStart, config: { ...mainStore.config } });
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
Reference in New Issue
Block a user