李昊 před 4 roky
rodič
revize
b34dfd2132

+ 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.