feat: enhance proxy management with caching and refresh logic

This commit is contained in:
Tunglies
2025-06-30 20:14:04 +08:00
parent 4435a5aee4
commit 18ef7f0272
9 changed files with 113 additions and 123 deletions

View File

@@ -3,6 +3,7 @@ import {
getProfiles,
patchProfile,
patchProfilesConfig,
forceRefreshProxies,
} from "@/services/cmds";
import { getProxies, updateProxy } from "@/services/api";
@@ -128,6 +129,9 @@ export const useProfiles = () => {
await patchProfile(profileData.current!, { selected: newSelected });
console.log("[ActivateSelected] 代理选择配置保存成功");
// 切换节点后强制刷新后端缓存
await forceRefreshProxies();
setTimeout(() => {
mutate("getProxies", getProxies());
}, 100);