李昊 %!s(int64=4) %!d(string=hai) anos
pai
achega
f392070b7f
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      GxPress/Api/GxPress.Api/AppControllers/UserController.cs

+ 7 - 0
GxPress/Api/GxPress.Api/AppControllers/UserController.cs

@@ -79,6 +79,11 @@ namespace GxPress.Api.AppControllers
         public async Task<UserSignInResult> SignIn(UserSignInRequest request)
         {
             var result = await _userRepository.SignInAsync(request);
+            if (result.IsAddUser)
+            {
+                //添加环信
+                await _userRepository.CreateMiUserAsync(result.UserEntity);
+            }
             var claims = new[]
             {
                 new Claim(ClaimTypes.NameIdentifier, result.UserId.ToString()),
@@ -102,8 +107,10 @@ namespace GxPress.Api.AppControllers
             {
                 var result = await _userRepository.SignInAsync(request);
                 if (result.IsAddUser)
+                {
                     //添加环信
                     await _userRepository.CreateMiUserAsync(result.UserEntity);
+                }
                 var claims = new[]
                 {
                 new Claim(ClaimTypes.NameIdentifier, result.UserId.ToString()),