- Replace favicon.svg in admin panel with new brand logo design - Add logo.png and logo.svg files to dedicated logo directory - Update miniprogram with new logo assets (logo.png and logo.svg) - Add README-UPLOAD.md documentation for miniprogram upload functionality - Update miniprogram app.js and config.js for logo integration - Update miniprogram user page (pages/user/index.js) to use new branding - Update server upload route to handle new logo assets - Add test-upload.js for upload functionality testing - Update server .env configuration for asset handling - Standardize brand visual identity across admin, miniprogram, and server platforms
47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
/**
|
|
* 小程序配置文件
|
|
* 请根据实际环境修改以下配置
|
|
*/
|
|
|
|
// 开发环境配置
|
|
const devConfig = {
|
|
// API 基础地址(本地开发)
|
|
baseUrl: "http://127.0.0.1:3001",
|
|
// WebSocket 地址(本地开发)
|
|
wsUrl: "ws://127.0.0.1:3001/ws",
|
|
};
|
|
|
|
// 生产环境配置
|
|
const prodConfig = {
|
|
// API 基础地址(生产环境,请替换为实际域名)
|
|
baseUrl: "https://yingsa-server.ethan.team",
|
|
// WebSocket 地址(生产环境,请替换为实际域名)
|
|
wsUrl: "wss://yingsa-server.ethan.team/ws",
|
|
};
|
|
|
|
// 根据环境变量选择配置
|
|
// 小程序可以通过 __wxConfig.envVersion 获取当前环境
|
|
// develop: 开发版, trial: 体验版, release: 正式版
|
|
const getEnv = () => {
|
|
try {
|
|
// 尝试获取微信环境
|
|
const envVersion =
|
|
typeof __wxConfig !== "undefined" && __wxConfig && __wxConfig.envVersion
|
|
? __wxConfig.envVersion
|
|
: "develop";
|
|
return envVersion !== "develop" ? "production" : "development";
|
|
} catch (e) {
|
|
return "development";
|
|
}
|
|
};
|
|
|
|
const env = getEnv();
|
|
const config = env === "production" ? prodConfig : devConfig;
|
|
|
|
module.exports = Object.assign({}, config, {
|
|
env,
|
|
uploadMaxSize: 5,
|
|
requestTimeout: 30000,
|
|
version: "1.0.0",
|
|
});
|