镜像制作
This commit is contained in:
75
schoolNewsWeb/public/app-config.js
Normal file
75
schoolNewsWeb/public/app-config.js
Normal file
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* 应用配置文件 - 可独立替换
|
||||
*
|
||||
* 此文件与 src/config/index.ts 的配置结构完全对应
|
||||
* 可以整个替换此文件来修改配置,无需重新构建镜像
|
||||
*
|
||||
* Docker部署:
|
||||
* 1. 修改此文件
|
||||
* 2. 挂载到容器:-v ./app-config.js:/app/config/app-config.js
|
||||
* 3. 重启容器即可生效
|
||||
*/
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
// ============================================
|
||||
// 配置定义
|
||||
// ============================================
|
||||
window.APP_RUNTIME_CONFIG = {
|
||||
// 环境标识
|
||||
env: 'production',
|
||||
|
||||
// API 配置
|
||||
api: {
|
||||
baseUrl: '/schoolNewsServ', // API基础路径
|
||||
timeout: 30000 // 请求超时(毫秒)
|
||||
},
|
||||
|
||||
// 应用基础路径
|
||||
baseUrl: '/schoolNewsWeb/',
|
||||
|
||||
// 文件配置
|
||||
file: {
|
||||
downloadUrl: '/schoolNewsServ/file/download/',
|
||||
uploadUrl: '/schoolNewsServ/file/upload',
|
||||
maxSize: {
|
||||
image: 5, // MB
|
||||
video: 100, // MB
|
||||
document: 10 // MB
|
||||
},
|
||||
acceptTypes: {
|
||||
image: 'image/*',
|
||||
video: 'video/*',
|
||||
document: '.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx'
|
||||
}
|
||||
},
|
||||
|
||||
// Token 配置
|
||||
token: {
|
||||
key: 'token',
|
||||
refreshThreshold: 300000 // 5分钟(毫秒)
|
||||
},
|
||||
|
||||
// 公共路径
|
||||
publicImgPath: '/schoolNewsWeb/img',
|
||||
publicWebPath: '/schoolNewsWeb',
|
||||
|
||||
// 功能开关(可自由扩展)
|
||||
features: {
|
||||
enableDebug: false,
|
||||
enableMockData: false
|
||||
// 你可以添加更多功能开关
|
||||
// enableXXX: false
|
||||
}
|
||||
};
|
||||
|
||||
// 配置加载完成标记
|
||||
window.__CONFIG_LOADED__ = true;
|
||||
|
||||
// 控制台输出配置信息(可选)
|
||||
if (console && console.log) {
|
||||
console.log('%c[配置]%c app-config.js 已加载', 'color: green; font-weight: bold', 'color: inherit');
|
||||
console.log('[配置] 环境:', window.APP_RUNTIME_CONFIG.env);
|
||||
console.log('[配置] API地址:', window.APP_RUNTIME_CONFIG.api.baseUrl);
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user