INNER CODE UNIT · TypeScript
updateLocalApiConfig
Simprint/simprint · plugins/pages/api-ai/src/api/index.ts:30
export async function updateLocalApiConfig(
payload: UpdateLocalApiConfigRequest
): Promise<LocalApiConfig> {
const result = await post<LocalApiConfig>(API_ENDPOINTS.UPDATE_CONFIG, payload);
if (!isSuccess(result) || !result.data) {
throw new Error(result.message || '更新配置失败');
}
return result.data;
}
export async function resetLocalApiKey(): Promise<ResetLocalApiKeyResponse> {
const result = await post<ResetLocalApiKeyResponse>(API_ENDPOINTS.RESET_API_KEY, {});
if (!isSuccess(result) || !result.data) {
throw new Error(result.message || '重置密钥失败');
}
return result.data;