From 152f48ca3cae46bbffca3fa0af4bc9e8216fafff Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期五, 11 十月 2024 10:39:28 +0800
Subject: [PATCH] 两次打卡必须超过10分钟!

---
 cylsg/cylsg.Application/LogoInController.cs |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/cylsg/cylsg.Application/LogoInController.cs b/cylsg/cylsg.Application/LogoInController.cs
index 8521f42..0ee4cfd 100644
--- a/cylsg/cylsg.Application/LogoInController.cs
+++ b/cylsg/cylsg.Application/LogoInController.cs
@@ -15,6 +15,7 @@
     /// 鐧诲綍
     /// </summary>
     [DynamicApiController]
+    [ApiDescriptionSettings("Default@1")]
     public class LogoIn
     {
         private readonly IWechatService _wechatService;
@@ -47,7 +48,7 @@
             }
             var jwt = new EzJwtModel()
             {
-                ITCode = user.ItCode,
+                //ITCode = user.ItCode, 涓嶅湪鏄庢枃涓娇鐢↖tcode 
                 NickName = user.Nickname,
                 UserID = user.Id,
 
@@ -83,6 +84,9 @@
                 //娌℃湁鐢ㄦ埛 锛岄渶瑕佹柊寤虹敤鎴�
                 var phone = await _wechatService.GetPhone(Param.Bindgetphonenumber);
 
+
+                 user = await UserRes.GetFirstAsync(x => x.ItCode == phone);
+                if(user == null) { 
                 user = new User
                 {
 
@@ -93,18 +97,26 @@
                     ItCode = phone,
                     PassWord = "123456",
                     WxOpenId = opeid,
-
+                    CreateBy="寰俊娉ㄥ唽鐧诲綍",
+                    CreateTime = DateTime.UtcNow,
 
 
                 };
 
-                await UserRes.EzInsertAsync(user);
 
-               
+              user=    await UserRes.InsertReturnEntityAsync(user);
+                }
+                else
+                {
+                    user.WxOpenId = opeid;
+                    await UserRes.EzUpdateAsync(user);
+                }
+
+
             }
             var jwt = new EzJwtModel()
             {
-                ITCode = user.ItCode,
+               // ITCode = user.ItCode,
                 NickName = user.Nickname,
                 UserID = user.Id,
 
@@ -122,9 +134,7 @@
 
         }
 
-
-
-       
+      
 
     }
     /// <summary>

--
Gitblit v1.9.1