refactor: 移除polling-store,重构setting-store

This commit is contained in:
yangsy
2026-01-19 15:15:38 +08:00
parent b7b6b216fb
commit 6771abec31
29 changed files with 197 additions and 185 deletions
@@ -8,17 +8,17 @@ import { computed, watch } from 'vue';
export const useVerifyUserQuery = () => {
const queryClient = useQueryClient();
const settingStore = useSettingStore();
const { offlineDev } = storeToRefs(settingStore);
const { activeRequests } = storeToRefs(settingStore);
watch(offlineDev, (offline) => {
if (offline) {
watch(activeRequests, (active) => {
if (!active) {
queryClient.cancelQueries({ queryKey: [VERIFY_USER_QUERY_KEY] });
}
});
return useQuery({
queryKey: [VERIFY_USER_QUERY_KEY],
enabled: computed(() => !offlineDev.value),
enabled: computed(() => activeRequests.value),
refetchInterval: 10 * 1000,
queryFn: async ({ signal }) => {
await verifyApi({ signal });