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密钥
async loadApiKeys() {
try {
const config = await this.getConfig();
if (config['api-keys']) {
this.renderApiKeys(config['api-keys']);
}
const data = await this.makeRequest('/api-keys');
const apiKeysValue = data?.['api-keys'] || [];
const keys = Array.isArray(apiKeysValue) ? apiKeysValue : [];
this.renderApiKeys(keys);
} catch (error) {
console.error('加载API密钥失败:', error);
}