From e741513f2ce67ba642cb0d978e00240cfb5789f5 Mon Sep 17 00:00:00 2001
From: tangxu <76880903@qq.com>
Date: 星期三, 18 一月 2023 11:05:37 +0800
Subject: [PATCH] 修改小程序登录

---
 Application/IStation.Application.User/user_login/UserLogin_Controller.cs |  114 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 107 insertions(+), 7 deletions(-)

diff --git a/Application/IStation.Application.User/user_login/UserLogin_Controller.cs b/Application/IStation.Application.User/user_login/UserLogin_Controller.cs
index 19104c6..e2768af 100644
--- a/Application/IStation.Application.User/user_login/UserLogin_Controller.cs
+++ b/Application/IStation.Application.User/user_login/UserLogin_Controller.cs
@@ -106,7 +106,7 @@
                     _httpContextAccessor.HttpContext.SigninToSwagger(accessToken);
                     vm.Token = accessToken;
                 }
-               
+
             }
 
             return vm;
@@ -117,25 +117,29 @@
         /// </summary>
         [Route("FromCorpWechatApplet@V1.0")]
         [HttpPost]
-        public UserLoginOutput FromCorpWechatApplet(UserLoginCorpWechatAppletInput input) 
+        public ApplicationViewModel.UserLogin FromCorpWechatApplet(UserLoginCorpWechatAppletInput input)
         {
             var message = input.Adapt<UserLoginCorpWechatAppletInput, Model.WechatAppletMessage>();
             var loginIp = HttpContextHelper.GetRemoteIpAddress(_httpContextAccessor.HttpContext.Request);
             var user = _service.LoginCorp
                 (input.CorpID, input.SoftType, input.SoftTag, input.LoginName, input.LoginPwd, loginIp, message.ToJson(), out Model.eLoginStatus loginStatus);
-            var vm = new UserLoginOutput()
+            var vm = new ApplicationViewModel.UserLogin()
             {
                 Status = loginStatus,
-                User = user?.Adapt<Model.User, UserDto>()
+                User = user?.Adapt<Model.User, ApplicationViewModel.UserDto4Wechat>()
             };
 
             if (loginStatus == Model.eLoginStatus.Success)
             {
+                if (user != null)
+                {
+                    vm.User.EmployeeID = user.ID;
+                }
                 if (Settings.WebApi.EnableJwt)
                 {
                     // token
                     var accessToken = JWTEncryption.Encrypt(new Dictionary<string, object>()
-                    {
+                    { 
                          { ClaimConst.UserID, user.ID },  // 鐢ㄦ埛鏍囪瘑
                          { ClaimConst.LoginName,user.LoginName }, // 鐧诲綍鍚嶇О
                          { ClaimConst.LoginPwd,user.LoginPwd }, // 鐧诲綍瀵嗙爜
@@ -150,7 +154,103 @@
 
             return vm;
         }
-
-
     }
 }
+
+    
+    namespace IStation.ApplicationViewModel
+    {
+        /// <summary>
+        /// 鐢ㄦ埛鐧诲綍杈撳嚭
+        /// </summary>
+        public class UserLogin
+        {
+            /// <summary>
+            /// 鐘舵��
+            /// </summary>
+            public Model.eLoginStatus Status { get; set; }
+
+            /// <summary>
+            /// 鐢ㄦ埛
+            /// </summary>
+            public UserDto4Wechat User { get; set; }
+
+            /// <summary>
+            /// 浠ょ墝
+            /// </summary>
+            public string Token { get; set; }
+        }
+       
+    /// <summary>
+    /// 
+    /// </summary>
+    public class UserDto4Wechat
+        {
+        /// <summary>
+        /// 
+        /// </summary>
+        public string LastLoginWxUserCode { get; set; }
+        /// <summary>
+        /// 鏍囪瘑
+        /// </summary>	
+        public long EmployeeID { get; set; }
+
+            /// <summary>
+            /// 鏍囪瘑
+            /// </summary>	
+            public long ID { get; set; }
+
+            /// <summary>
+            /// 瀹㈡埛鏍囪瘑
+            /// </summary>	
+            public long CorpID { get; set; }
+
+            /// <summary>
+            /// 鍏宠仈绫诲瀷
+            /// </summary>	
+            public string RelatedType { get; set; }
+
+            /// <summary>
+            /// 鍏宠仈鏍囪瘑
+            /// </summary>	
+            public long RelatedID { get; set; }
+
+            /// <summary>
+            /// 鏄惁涓虹鐞嗗憳
+            /// </summary>	
+            public bool IsAdmin { get; set; }
+
+            /// <summary>
+            /// 鐧诲綍鍚嶇О
+            /// </summary>	
+            public string LoginName { get; set; }
+
+            /// <summary>
+            /// 鐧诲綍鍥剧墖
+            /// </summary>	
+            public string LoginImg { get; set; }
+
+            /// <summary>
+            /// 鐪熷疄鍚嶇О
+            /// </summary>	
+            public string RealName { get; set; }
+
+            /// <summary>
+            /// 鎵嬫満鍙风爜
+            /// </summary>	
+            public string Telphone { get; set; }
+ 
+ 
+
+ 
+            /// <summary>
+            /// 浣跨敤鐘舵��
+            /// </summary>	
+            public Model.eUseStatus UseStatus { get; set; }
+ 
+ 
+
+             
+        }
+    }
+ 

--
Gitblit v1.9.3