diff --git a/.env b/.env index 9912402..9727131 100644 --- a/.env +++ b/.env @@ -1,11 +1,11 @@ IS_DEBUG="true" -GRPC_ENDPOINT="10.66.66.234:9090" -COSMOS_ENDPOINT="http://10.66.66.234:26657" -ACCOUNT_NAME="ccvdexre" -TRAFFIC_OBFUSCATE="10.66.66.234:8180" -NODE_SECRET= "initial typical business width enforce buddy magic country piano head cable blossom gate caught disagree pepper moral pair vessel protect mixture deposit artwork liquid" -VIET_EVENTS_URL="ws://10.66.66.234:8080/events" -VITE_BASE_URL="http://10.66.66.234:8080" -VITE_BLOCK_URL="http://10.66.66.234:1317" +GRPC_ENDPOINT="10.66.66.230:9090" +COSMOS_ENDPOINT="http://10.66.66.230:26657" +ACCOUNT_NAME="gmkrucb5apcmq" +TRAFFIC_OBFUSCATE="10.66.66.230:8180" +NODE_SECRET= "horror fence lecture sunset tunnel badge strategy curtain boat wonder police junior spider attack favorite farm trade chicken violin dust strike clap clutch toilet" +VIET_EVENTS_URL="ws://10.66.66.230:8080/events" +VITE_BASE_URL="http://10.66.66.230:8080" +VITE_BLOCK_URL="http://10.66.66.230:1317" NODE_OPTIONS=--max-old-space-size=8192 # $env:NODE_OPTIONS="--max-old-space-size=8192"; pnpm run web:build diff --git a/src-tauri/sidecar/paw-install-service-x86_64-pc-windows-msvc.exe b/src-tauri/sidecar/paw-install-service-x86_64-pc-windows-msvc.exe index d78659e..0650969 100644 Binary files a/src-tauri/sidecar/paw-install-service-x86_64-pc-windows-msvc.exe and b/src-tauri/sidecar/paw-install-service-x86_64-pc-windows-msvc.exe differ diff --git a/src-tauri/sidecar/paw-system-service-x86_64-pc-windows-msvc.exe b/src-tauri/sidecar/paw-system-service-x86_64-pc-windows-msvc.exe index eaa3c32..fd2d953 100644 Binary files a/src-tauri/sidecar/paw-system-service-x86_64-pc-windows-msvc.exe and b/src-tauri/sidecar/paw-system-service-x86_64-pc-windows-msvc.exe differ diff --git a/src-tauri/sidecar/paw-uninstall-service-x86_64-pc-windows-msvc.exe b/src-tauri/sidecar/paw-uninstall-service-x86_64-pc-windows-msvc.exe index 67252df..b995ed0 100644 Binary files a/src-tauri/sidecar/paw-uninstall-service-x86_64-pc-windows-msvc.exe and b/src-tauri/sidecar/paw-uninstall-service-x86_64-pc-windows-msvc.exe differ diff --git a/src/pages/new-home/index.tsx b/src/pages/new-home/index.tsx index 5d3b064..eeb2341 100644 --- a/src/pages/new-home/index.tsx +++ b/src/pages/new-home/index.tsx @@ -150,31 +150,33 @@ const NewHome = () => { }, [dataInfo.applicationDiversion]); // 处理代理开关 - const handleProxyToggle = async ( - isProxyEnabled: boolean, - isCoreRunning: boolean - ) => { - if (isProxyLoading) return; - try { - // 如果核心未运行,先启动核心 - if (!isCoreRunning) { - await commands.startCore(); + const handleProxyToggle = useCallback( + async (isProxyEnabled: boolean, isCoreRunning: boolean) => { + // console.log(isProxyLoading, "isProxyLoadingisProxyLoading"); + if (isProxyLoading) return; + try { + // 如果核心未运行,先启动核心 + if (!isCoreRunning) { + await commands.startCore(); + } + + setIsProxyLoading(true); + // 切换代理状态 + await dispatch(isProxyEnabled ? disableProxy() : enableProxy()).unwrap(); + setIsProxyLoading(false); + console.log(`Proxy ${isProxyEnabled ? "关闭成功" : "开启成功"}`); + } catch (error) { + const errorMessage = isProxyEnabled + ? "关闭代理失败!" + : "开启代理失败,请检查节点配置、或重新尝试开启"; + errorToast(errorMessage, toast); + console.error("Proxy toggle failed:", error); + } finally { + setIsProxyLoading(false); } - - setIsProxyLoading(true); - // 切换代理状态 - await dispatch(isProxyEnabled ? disableProxy() : enableProxy()).unwrap(); - } catch (error) { - const errorMessage = isProxyEnabled - ? "关闭代理失败!" - : "开启代理失败,请检查节点配置、或重新尝试开启"; - errorToast(errorMessage, toast); - console.error("Proxy toggle failed:", error); - } finally { - setIsProxyLoading(false); - } - }; - + }, + [dispatch, isProxyLoading, isCoreRunning, isProxyEnabled] + ); const initData = async () => { const passAuthentication = await getPassAuthentication(); const trafficObfuscation = await getTrafficObfuscation(); diff --git a/src/store/serviceSlice.ts b/src/store/serviceSlice.ts index 6bdbe80..8faef2b 100644 --- a/src/store/serviceSlice.ts +++ b/src/store/serviceSlice.ts @@ -51,7 +51,6 @@ export const stopCore = createAsyncThunk( ) export const enableProxy = createAsyncThunk('service/enableProxy', async () => { - console.log("开启代理了?") const result = await commands.enableProxy() return result })