refactor: Use Tauri Http API

This commit is contained in:
MystiPanda
2024-01-14 18:35:10 +08:00
parent ba7242a815
commit a6acb15a00
5 changed files with 67 additions and 55 deletions

View File

@@ -10,7 +10,7 @@ import { alpha, List, Paper, ThemeProvider } from "@mui/material";
import { listen } from "@tauri-apps/api/event";
import { appWindow } from "@tauri-apps/api/window";
import { routers } from "./_routers";
import { getAxios } from "@/services/api";
import { refreshClashInfo } from "@/services/api";
import { useVerge } from "@/hooks/use-verge";
import LogoSvg from "@/assets/image/logo.svg?react";
import { BaseErrorBoundary, Notice } from "@/components/base";
@@ -50,7 +50,7 @@ const Layout = () => {
listen("verge://refresh-clash-config", async () => {
// the clash info may be updated
await getAxios(true);
await refreshClashInfo();
mutate("getProxies");
mutate("getVersion");
mutate("getClashConfig");