Files
YG_FT_Platform/web/js/api.js
WIN-JHFT4D3SIVT\caoxiaozhu 513e96082c 重构了main.html的主函数
重构了大量的页面的sidebar
优化了代码结构
2026-02-02 09:22:52 +08:00

22 lines
571 B
JavaScript

/**
* 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();