李昊 4 年之前
父節點
當前提交
b34dfd2132
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      GxPress/Api/GxPress.Api/AppControllers/UserController.cs

+ 8 - 2
GxPress/Api/GxPress.Api/AppControllers/UserController.cs

@@ -205,8 +205,14 @@ namespace GxPress.Api.AppControllers
                 user = new User();
                 user.Name = phone;
                 user.Phone = phone;
-                user.Id = await _userRepository.InsertAsync(user);
-                await _userRepository.CreateMiUserAsync(user);
+                if (await _userRepository.CreateMiUserAsync(user))
+                {
+                    user = new User();
+                    user.Name = phone;
+                    user.Phone = phone;
+                    user.ImId = phone;
+                    user.Id = await _userRepository.InsertAsync(user);
+                }
             }
             //TODO 短信验证码发送
             //return await _smsService.