王 垚
2021-02-28 d5ddf535c11458df512e62b504773401656ae74c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using Newtonsoft.Json.Linq;
using XhOA.Constants;
using System;
using Kingdee.BOS.WebApi.Client;
 
namespace XhOA.Untity
{
    public class CloudClient : K3CloudApiClient
    {
#if DEBUG
        public const string DbId = " ";//MDM
#else
        public const string DbId = "5ce8f62da69d38";
#endif
        public const string UserName = "Administrator";
        public const string PassWord = "888888";
        public CloudClient(string serverUrl = Url.KDApiUrl) : base(serverUrl)
        {
            var loginResult = ValidateLogin(DbId, UserName, PassWord, 2052);
            var resultType = JObject.Parse(loginResult)["LoginResultType"].Value<int>();
            //登录结果类型等于1,代表登录成功
            if (resultType != 1)
            {
                throw new Exception("登录失败!");
            }
        }
    }
}