From 452f7aa3fdd30953b53de1ac0c137db64857b400 Mon Sep 17 00:00:00 2001
From: lg <999544862qq.com>
Date: 星期三, 28 八月 2024 10:25:27 +0800
Subject: [PATCH] 暂无

---
 WebApi/Gs.User/Service/UserController.cs |   81 +++++++++++++++++++++++++++++++++++-----
 1 files changed, 70 insertions(+), 11 deletions(-)

diff --git a/WebApi/Gs.User/Service/UserController.cs b/WebApi/Gs.User/Service/UserController.cs
index 614295d..895fd7f 100644
--- a/WebApi/Gs.User/Service/UserController.cs
+++ b/WebApi/Gs.User/Service/UserController.cs
@@ -8,6 +8,7 @@
 using System.Linq;
 using System.Text;
 using Gs.User.Modes;
+using System.Diagnostics;
 
 namespace Gs.User.Service
 {
@@ -55,17 +56,6 @@
                             System.Data.DataRow row = dset.Tables[0].Rows[0];
                             m.loginGuid = Guid.Parse(row["loginGuid"].ToString());
                             m.loginOrgGuid = row["loginOrgGuid"].ToString();
-                            System.Text.StringBuilder sbR = new StringBuilder();
-                            if (dset.Tables.Count > 1 && dset.Tables[1].Rows.Count > 1)
-                            {
-                                foreach (System.Data.DataRow r in dset.Tables[1].Rows)
-                                {
-                                    if (sbR.Length > 0)
-                                        sbR.Append(",");
-                                    sbR.Append(r["rightGuid"].ToString());
-                                }
-                            }
-                            m.loginRightList = sbR.ToString();
                             return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "鐧诲綍鎴愬姛锛�");
                         }
                     }
@@ -81,5 +71,74 @@
             }
             return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Exception, "鐧诲綍澶辫触锛�");
         }
+
+        /// <summary>
+        /// 璇诲彇鐢ㄦ埛鐧诲綍淇℃伅
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [RequestMethod(RequestMethods.POST)]
+        public ReturnDto<System.Dynamic.ExpandoObject> GetUserInfo([FromBody] UserLogin model)
+        {
+            Guid userGuid = model.userGuid;
+            DataSet dset = new DataSet();
+            dynamic m = new System.Dynamic.ExpandoObject();
+            using (SqlConnection conn = new SqlConnection(DbHelperSQL.strConn))
+            {
+                using (SqlCommand cmd = new SqlCommand("[prc_user_info]", conn))
+                {
+                    try
+                    {
+                        conn.Open();
+                        cmd.CommandType = CommandType.StoredProcedure;
+                        SqlParameter[] parameters = new SqlParameter[] {
+                                new SqlParameter("@userGuid",userGuid),
+                            };
+                        foreach (SqlParameter parameter in parameters)
+                        {
+                            cmd.Parameters.Add(parameter);
+                        }
+                        using (SqlDataAdapter dt = new SqlDataAdapter(cmd))
+                        {
+                            dt.Fill(dset, "0");
+                        }
+                        if (dset != null && dset.Tables.Count > 0 && dset.Tables[0].Rows.Count > 0)
+                        {
+                            System.Data.DataRow row = dset.Tables[0].Rows[0];
+                            m.loginGuid = Guid.Parse(row["loginGuid"].ToString());
+                            m.loginOrgGuid = row["loginOrgGuid"].ToString();
+                            m.list = new List<MenuAction>();
+                            if (dset.Tables.Count > 1 && dset.Tables[1].Rows.Count > 1)
+                            {
+                                foreach (DataRow dr in dset.Tables[1].Rows)
+                                {
+                                    m.list.Add(
+                                        new MenuAction()
+                                        {
+                                            guid = Guid.Parse(dr["rightGuid"].ToString()),
+                                            upGuid = dr["upGuid"].ToString().Length > 0 ? Guid.Parse(dr["upGuid"].ToString()) : null,
+                                            name = dr["name"].ToString(),
+                                            icon = dr["icon"].ToString(),
+                                            fromPath = dr["fromPath"].ToString(),
+                                            category = int.Parse(dr["category"].ToString()),
+                                        }
+                                    );
+                                }
+                                return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "鐧诲綍鎴愬姛锛�");
+                            }
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        LogHelper.Debug(this.ToString(), "GetUserInfo error锛�" + ex.Message);
+                    }
+                    finally
+                    {
+                        conn.Close();
+                    }
+                }
+            }
+            return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Exception, "鐧诲綍澶辫触锛�");
+        }
     }
 }

--
Gitblit v1.9.3