fix(dealer): 解决经销商申请注册流程中的角色分配问题

- 添加了对用户ID存在性的检查,避免注册时用户信息缺失导致的错误
- 实现了更健壮的角色查询逻辑,当查询不到角色时使用默认角色ID进行兜底
- 新增了addUserRole API方法用于在用户无角色时创建默认角色
- 优化了角色分配逻辑,支持upsert操作以处理不同后端实现方式
- 将页面跳转从navigateBack改为switchTab,确保注册后正确返回到"我的"页面
- 更新了API基础URL配置,统一指向新的mp-api域名
- 修复了二维码组件中的API地址引用,保持与新域名的一致性
This commit is contained in:
2026-01-27 17:50:16 +08:00
parent a4938fbe31
commit ed02db5a8d
4 changed files with 84 additions and 16 deletions

View File

@@ -3,19 +3,19 @@ export const ENV_CONFIG = {
// 开发环境
development: {
// API_BASE_URL: 'http://127.0.0.1:9200/api',
API_BASE_URL: 'https://cms-api.websoft.top/api',
API_BASE_URL: 'https://mp-api.websoft.top/api',
APP_NAME: '开发环境',
DEBUG: 'true',
},
// 生产环境
production: {
API_BASE_URL: 'https://cms-api.websoft.top/api',
API_BASE_URL: 'https://mp-api.websoft.top/api',
APP_NAME: '桂乐淘',
DEBUG: 'false',
},
// 测试环境
test: {
API_BASE_URL: 'https://cms-api.s209.websoft.top/api',
API_BASE_URL: 'https://mp-api.s209.websoft.top/api',
APP_NAME: '测试环境',
DEBUG: 'true',
}