From 330444dff55dce750136971f64a967ba243151f8 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期五, 01 十一月 2024 10:08:46 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/InvokeHelper.cs |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/WebAPI/InvokeHelper.cs b/WebAPI/InvokeHelper.cs
index ae7824f..dcf04ee 100644
--- a/WebAPI/InvokeHelper.cs
+++ b/WebAPI/InvokeHelper.cs
@@ -1,5 +1,6 @@
 锘縰sing System;
 using System.Collections.Generic;
+using System.Data;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -40,6 +41,39 @@
             return httpClient.SyncRequest();
         }
 
+        public static string LoginUser(string user)
+        {
+            //浠嶤鐩橀厤缃枃浠惰幏鍙� CLOUD缃戝潃銆佽处濂椾俊鎭�佺櫥褰曠敤鎴枫�佺櫥褰曞瘑鐮�
+            Pub_Class.ClsPub.GetCLOUDLoginInfo(ref Pub_Class.ClsPub.sExeReturnInfo);
+            var useName = Pub_Class.ClsPub.sCLOUDUseName;
+            var pwd = Pub_Class.ClsPub.sCLOUDPsd;
+            var dbId = Pub_Class.ClsPub.sCLOUDAcc;
+            CloudUrl = Pub_Class.ClsPub.sCLOUDUrl;
+
+            //鑾峰彇鐢ㄦ埛缁戝畾閲戣澏璐﹀彿
+            DataSet ds;
+            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+            ds = oCN.RunProcReturn("exec h_p_API_GetCloudUserByLoginUser '" + user.ToString() + "'", "h_p_API_GetCloudUserByLoginUser");
+
+            if (ds != null && ds.Tables[0].Rows.Count != 0)
+            {
+                useName = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HCloudUserName"]);
+                pwd = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HCloudUserPsd"]);
+            }
+
+            HttpClient httpClient = new HttpClient();
+            httpClient.Url = string.Concat(CloudUrl, "Kingdee.BOS.WebApi.ServicesStub.AuthService.ValidateUser.common.kdsvc");
+
+            List<object> Parameters = new List<object>();
+            Parameters.Add(dbId);//璐﹀鏍囩ず
+            Parameters.Add(useName);//鐢ㄦ埛鍚�
+            Parameters.Add(pwd);//瀵嗙爜
+            Parameters.Add(2052);//2052浠h〃涓枃
+            httpClient.Content = JsonConvert.SerializeObject(Parameters);
+
+            return httpClient.SyncRequest();
+        }
+
         public static async Task<string> LoginAsync()
         {
             HttpClient httpClient = new HttpClient();

--
Gitblit v1.9.1