feat: 优化config
This commit is contained in:
		| @@ -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('检测失败'); | ||||
|     } | ||||
|   }, | ||||
| })); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user