李昊 4 年之前
父節點
當前提交
8b05b46212
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      GxPress/Repository/GxPress.Repository.Implement/UserRepository.cs

+ 5 - 1
GxPress/Repository/GxPress.Repository.Implement/UserRepository.cs

@@ -310,7 +310,11 @@ namespace GxPress.Repository.Implement
                     user = await GetByPhoneAsync(request.Phone);
                     //用户不存在,自动注册
                     if (user == null)
-                        throw new BusinessException("用户不存在");
+                    {
+                        user.Name = request.Phone;
+                        user.Phone = request.Phone;
+                        user.Id = await InsertAsync(user);
+                    }
                 }
                 else
                     user = await GetByOpenIdAsync(request.OpenId);