mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-03 03:10:50 +08:00
refactor(api-keys): fetch keys from API and reduce log limit
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user