HaniBlindBox/honey_box/common/env.js
2026-03-14 11:25:19 +08:00

40 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 项目环境配置文件
* 集中管理所有环境相关的配置参数
*
* 更新说明:
* - 2026年迁移至 .NET 10 后端
* - 开发环境http://localhost:5238 http://192.168.195.15:2822
* - 测试环境:
* - 生产环境:
*/
// 测试环境配置 - .NET 10 后端
const testing = {
// baseUrl: 'https://app.zpc-xy.com/honey/api',
baseUrl: 'https://api.ejp.shhmkjgs.cn',
// baseUrl: 'http://192.168.1.24:5238',
// baseUrl: 'http://192.168.195.15:2822',
imageUrl: 'https://youdas-1308826010.cos.ap-shanghai.myqcloud.com',
loginPage: '',
wxAppId: ''
};
// 根据环境变量选择对应配置
let currentEnv = testing; //production;//testing;//production_wz;
// 衍生配置
const config = {
...currentEnv,
// API请求完整路径
apiBaseUrl: currentEnv.baseUrl + '/api/',
// 微信登录重定向URL
wxLoginUrl: `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${currentEnv.wxAppId}&redirect_uri=${escape(currentEnv.loginPage)}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`,
// 图片资源路径
imageBaseUrl: currentEnv.imageUrl + '/static/web',
// 图标资源路径
iconBaseUrl: currentEnv.imageUrl + '/static/web/static/'
};
export default config;