using Kingdee.BOS.WebApi.Client; using Newtonsoft.Json.Linq; using XhOA.Constants; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace XhOA.Untity { public class CloudClient : K3CloudApiClient { #if DEBUG public const string DbId = "5df2f8e7f1848b";//MDM #else public const string DbId = "5ce8f62da69d38"; #endif public const string UserName = "Administrator"; public const string PassWord = "Xhgj1234"; public CloudClient(string serverUrl = Url.KDApiUrl) : base(serverUrl) { var loginResult = ValidateLogin(DbId, UserName, PassWord, 2052); var resultType = JObject.Parse(loginResult)["LoginResultType"].Value(); //登录结果类型等于1,代表登录成功 if (resultType != 1) { throw new Exception("登录失败!"); } } } }