Compare commits

...

2 Commits

Author SHA1 Message Date
kk d392ff98b7 apiBaseUrl改成https
Uni-app H5 Deploy (Prod + Staging) / deploy (release) Successful in 41s
2026-07-11 18:22:44 +08:00
kk 18870f3e7d 注册成功后保存user_info
Uni-app H5 Deploy (Prod + Staging) / deploy (release) Successful in 46s
2026-07-11 18:05:45 +08:00
2 changed files with 16 additions and 10 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
*/ */
const prod = { const prod = {
// 业务 API 地址(vms-api // 业务 API 地址(vms-api
apiBaseUrl: 'http://101.200.86.98:4000', apiBaseUrl: 'https://vmsapi.arklinksmart.cn',
// 网关地址(vms-gateway)— 用户授权、短信等接口走网关 // 网关地址(vms-gateway)— 用户授权、短信等接口走网关
apiGatewayUrl: 'https://gateway.arklinksmart.cn', apiGatewayUrl: 'https://gateway.arklinksmart.cn',
+15 -9
View File
@@ -187,19 +187,25 @@ export default {
// 保存 token // 保存 token
uni.setStorageSync('token', ret.data.token); uni.setStorageSync('token', ret.data.token);
// Mock 模式下,合并真实注册信息和 mock 配置 // 存储 user_info(至少有 user_id 就能开门)
const existing = uni.getStorageSync('user_info') || {};
const userInfo = {
user_id: ret.data.user_id || existing.user_id || '',
phone: this.phone || existing.phone || '',
nickname: existing.nickname || '',
avatar: existing.avatar || '',
};
// Mock 模式下补充 mock 数据
if (config.mockWechatLogin) { if (config.mockWechatLogin) {
const mockInfo = config.mockUser.user_info; const mockInfo = config.mockUser.user_info;
const userInfo = { userInfo.nickname = userInfo.nickname || mockInfo.nickname;
user_id: ret.data.user_id || mockInfo.user_id, userInfo.avatar = userInfo.avatar || mockInfo.avatar;
phone: this.phone, // 使用真实注册的手机号
nickname: mockInfo.nickname,
avatar: mockInfo.avatar,
};
uni.setStorageSync('user_info', userInfo);
console.log('[register] Mock 模式,合并用户信息:', userInfo);
} }
uni.setStorageSync('user_info', userInfo);
console.log('[register] 存储 user_info:', userInfo);
// 清除临时数据 // 清除临时数据
uni.removeStorageSync('temp_token'); uni.removeStorageSync('temp_token');
uni.removeStorageSync('auth_info'); uni.removeStorageSync('auth_info');