This commit is contained in:
2026-05-11 00:32:03 +08:00
parent 2535bec2ed
commit 10022ae048
32 changed files with 2450 additions and 203 deletions
+24 -4
View File
@@ -10,22 +10,42 @@ export const useDnfHelperStore = defineStore("dnfHelperStore", () => {
},
});
const loading = ref(false);
const errorMessage = ref("");
const refleshHelperInfo = async (uid?: string) => {
if (!uid) return;
const data = await api.getHelperList(uid);
if (data) {
helperInfo.value = data;
console.log(helperInfo.value);
loading.value = true;
errorMessage.value = "";
try {
const data = await api.getHelperList(uid);
if (data) {
helperInfo.value = data;
}
} catch (error) {
errorMessage.value = error instanceof Error ? error.message : "同步助手数据失败";
throw error;
} finally {
loading.value = false;
}
};
const refreshHelperInfo = async (uid?: string) => {
await refleshHelperInfo(uid);
};
const logout = () => {
helperInfo.value = null;
errorMessage.value = "";
};
return {
helperInfo,
loading,
errorMessage,
refleshHelperInfo,
refreshHelperInfo,
logout,
};
});