refactor(api-keys): fetch keys from API and reduce log limit

This commit is contained in:
hkfires
2025-11-17 15:32:33 +08:00
parent fea36b1ca9
commit ae0e92a6ae
2 changed files with 5 additions and 5 deletions

View File

@@ -2,10 +2,10 @@ export const apiKeysModule = {
// 加载API密钥 // 加载API密钥
async loadApiKeys() { async loadApiKeys() {
try { try {
const config = await this.getConfig(); const data = await this.makeRequest('/api-keys');
if (config['api-keys']) { const apiKeysValue = data?.['api-keys'] || [];
this.renderApiKeys(config['api-keys']); const keys = Array.isArray(apiKeysValue) ? apiKeysValue : [];
} this.renderApiKeys(keys);
} catch (error) { } catch (error) {
console.error('加载API密钥失败:', error); console.error('加载API密钥失败:', error);
} }

View File

@@ -51,7 +51,7 @@ export const OAUTH_MAX_POLL_DURATION_MS = 5 * 60 * 1000;
* 最大日志显示行数 * 最大日志显示行数
* 限制内存占用,避免大量日志导致页面卡顿 * 限制内存占用,避免大量日志导致页面卡顿
*/ */
export const MAX_LOG_LINES = 10000; export const MAX_LOG_LINES = 2000;
/** /**
* 认证文件列表默认每页显示数量 * 认证文件列表默认每页显示数量