feat(invite): 新增邀请功能及二维码扫码登录支持

- 添加邀请记录、统计、来源统计、小程序码等数据模型
- 实现小程序码生成、邀请关系绑定、邀请场景处理等接口
- 新增扫码登录相关接口,支持生成二维码、检查状态、确认登录等操作
- 实现二维码内容解析和设备信息获取工具函数
- 添加礼品卡核销相关接口和解密工具函数
- 集成环境配置管理,支持开发、生产、测试环境切换
- 在过期时间页面集成登录二维码和核销二维码处理逻辑
- 添加邀请参数解析工具函数,支持从小程序启动参数中提取邀请信息
This commit is contained in:
2025-09-25 01:02:35 +08:00
parent c7a4a726c7
commit 791e98a8ec
26 changed files with 4181 additions and 4 deletions

42
config/env.ts Normal file
View File

@@ -0,0 +1,42 @@
// 环境变量配置
export const ENV_CONFIG = {
// 开发环境
development: {
API_BASE_URL: 'https://cms-api.websoft.top/api',
APP_NAME: '开发环境',
DEBUG: 'true',
},
// 生产环境
production: {
API_BASE_URL: 'https://cms-api.websoft.top/api',
APP_NAME: '时里院子市集',
DEBUG: 'false',
},
// 测试环境
test: {
API_BASE_URL: 'https://cms-api.s209.websoft.top/api',
APP_NAME: '测试环境',
DEBUG: 'true',
}
}
// 获取当前环境配置
export function getEnvConfig() {
const env = process.env.NODE_ENV || 'development'
if (env === 'production') {
return ENV_CONFIG.production
} else { // @ts-ignore
if (env === 'test') {
return ENV_CONFIG.test
} else {
return ENV_CONFIG.development
}
}
}
// 导出环境变量
export const {
API_BASE_URL,
APP_NAME,
DEBUG
} = getEnvConfig()