import { API_BASE_URL, getHeaders, handleResponse } from './util'; export interface Settings { /** 飞书配置 */ feishu: { /** 飞书应用ID */ app_id: string; /** 飞书应用密钥 */ app_secret: string; /** 飞书应用验证Token */ verification_token: string; /** 飞书应用加密Key */ encrypt_key: string; /** 飞书机器人接收ID */ receive_id: string; } } export const settingApi = { async update(settings: Settings) { const response = await fetch( `${API_BASE_URL}/api/setting`, { headers: getHeaders(), method: 'POST', body: JSON.stringify(settings) } ); return handleResponse(response); }, async get(): Promise { const response = await fetch( `${API_BASE_URL}/api/setting`, { headers: getHeaders() } ); return handleResponse(response); }, }