feat: 优化config

This commit is contained in:
2025-03-23 04:02:03 +08:00
parent 1d97ff88b9
commit cbbb48af97
6 changed files with 33 additions and 11 deletions

View File

@@ -14,6 +14,7 @@ interface ConfigStore {
formData: any;
setFormData: (formData: any) => void;
deleteConfig: (id: string) => Promise<void>;
detectConfig: () => Promise<void>;
}
export const useConfigStore = create<ConfigStore>((set, get) => ({
@@ -50,4 +51,14 @@ export const useConfigStore = create<ConfigStore>((set, get) => ({
toast.error('删除失败');
}
},
detectConfig: async () => {
const res = await queryConfig.detectConfig();
if (res.code === 200) {
const data = res?.data?.updateList || [];
console.log(data);
toast.success('检测成功');
} else {
toast.error('检测失败');
}
},
}));