重构了main.html的主函数

重构了大量的页面的sidebar
优化了代码结构
This commit is contained in:
2026-02-02 09:22:52 +08:00
33 changed files with 5566 additions and 2383 deletions

21
web/js/api.js Normal file
View File

@@ -0,0 +1,21 @@
/**
* API 配置模块
* 提供 API 基础地址和常用配置
*/
// API 基础地址配置
(function() {
if (typeof window.getApiBase !== 'function') {
window.getApiBase = () => {
const protocol = window.location.protocol;
const hostname = window.location.hostname;
return `${protocol}//${hostname}:7861/api`;
};
}
if (typeof window.API_BASE === 'undefined') {
window.API_BASE = window.getApiBase();
}
})();
// 导出 API_BASE 供其他模块使用
window.API_BASE = window.getApiBase();