王 垚
2020-12-08 20720f693791f2cbbfd432d31e3bde3f0ca7a07c
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
29
30
31
32
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<int>();
            //登录结果类型等于1,代表登录成功
            if (resultType != 1)
            {
                throw new Exception("登录失败!");
            }
        }
    }
}