mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-18 10:40:50 +08:00
refactor(config): reload editor and auth files via events
This commit is contained in:
@@ -1025,5 +1025,20 @@ export const authFilesModule = {
|
||||
// 清空文件输入框,允许重复上传同一文件
|
||||
event.target.value = '';
|
||||
}
|
||||
},
|
||||
|
||||
registerAuthFilesListeners() {
|
||||
if (!this.events || typeof this.events.on !== 'function') {
|
||||
return;
|
||||
}
|
||||
this.events.on('data:config-loaded', async (event) => {
|
||||
const detail = event?.detail || {};
|
||||
const keyStats = detail.keyStats || null;
|
||||
try {
|
||||
await this.loadAuthFiles(keyStats);
|
||||
} catch (error) {
|
||||
console.error('加载认证文件失败:', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user