import axios from 'axios'; import type { SystemSetting, SystemSettingGroupData, } from '../../share/types.ts'; export const SystemAPI = { // 获取所有系统设置 getSettings: async (): Promise => { try { const response = await axios.get('/settings'); return response.data.data; } catch (error) { throw error; } }, // 获取指定分组的系统设置 getSettingsByGroup: async (group: string): Promise => { try { const response = await axios.get(`/settings/group/${group}`); return response.data.data; } catch (error) { throw error; } }, // 更新系统设置 updateSettings: async (settings: Partial[]): Promise => { try { const response = await axios.put('/settings', settings); return response.data.data; } catch (error) { throw error; } }, // 重置系统设置 resetSettings: async (): Promise => { try { const response = await axios.post('/settings/reset'); return response.data.data; } catch (error) { throw error; } } };