This commit is contained in:
2025-09-16 22:11:19 +08:00
parent 562ec4abf9
commit 46c5682960
65 changed files with 1997 additions and 56 deletions

View File

@@ -12,3 +12,16 @@ const storageShopId = typeof uni !== 'undefined' ? (uni.getStorageSync('SHOP_ID'
export const SHOP_ID = Number(envShopId || storageShopId || 1);
// 默认用户(可移除):
// - 用途:开发/演示环境自动将用户固定为“张老板”id=2
// - 开关优先级:环境变量 > 本地存储 > 默认值
// - 生产默认关闭false开发可通过本地存储或环境变量开启
const envEnableDefaultUser = (typeof process !== 'undefined' && process.env && (process.env.VITE_APP_ENABLE_DEFAULT_USER || process.env.ENABLE_DEFAULT_USER)) || '';
const storageEnableDefaultUser = typeof uni !== 'undefined' ? (uni.getStorageSync('ENABLE_DEFAULT_USER') || '') : '';
export const ENABLE_DEFAULT_USER = String(envEnableDefaultUser || storageEnableDefaultUser || 'false').toLowerCase() === 'true';
const envDefaultUserId = (typeof process !== 'undefined' && process.env && (process.env.VITE_APP_DEFAULT_USER_ID || process.env.DEFAULT_USER_ID)) || '';
const storageDefaultUserId = typeof uni !== 'undefined' ? (uni.getStorageSync('DEFAULT_USER_ID') || '') : '';
export const DEFAULT_USER_ID = Number(envDefaultUserId || storageDefaultUserId || 2);