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

+ 4 - 6
GxPress/Api/GxPress.Api/AppControllers/UserController.cs

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