64.2、WebApi,第三方登录授权,引用WebApi.Client.dll调用WebApi接口原创
金蝶云社区-林荫大道cc身份
林荫大道cc
19人赞赏了该文章 8548次浏览 未经作者许可,禁止转载编辑于2020年07月18日 09:24:41
封面



64.1 



第三方登录授权:不需要密码



1、 第 62 节代码,引用WebApi


image.png



2、修改上一节代码


        private void button1_Click(object sender, EventArgs e)
        {
            K3CloudApiClient client = new K3CloudApiClient("http://127.0.0.1/k3cloud/");
            
            string loginResult = client.LoginByAppSecret(
                "5e5b91e99193fb",//账套
                "Administrator",//用户名
                "207096_0ccO69lKUJg4RU/ISdRM0x1N7iTYTqmu",//应用ID
                "27f834aa28f449d3b6ac95d9680d3d0a",//应用秘钥
                2052 //中文
                );
                
            Newtonsoft.Json.Linq.JObject loginResultObj = JObject.Parse(loginResult);
            
            JToken loginResultType;
            
            loginResultObj.TryGetValue("LoginResultType", out loginResultType);
            
            if(loginResultType !=null && loginResultType.Value<Int32>() == 1)
            {
                this.textBox2.Text = client.Save("BD_Customer", this.textBox1.Text);
            }
        }



image.png



3、点运行,自动生成客户


image.png


{
 "Creator": "",
 "Model": {
  "FCreateOrgId": {
   "FNumber": "100"
  },
  "FUseOrgId": {
   "FNumber": "100"
  },
  "FName": "客户测试4"
 }
}


image.png


总目录链接

https://vip.kingdee.com/article/649938720145912


64.2.zip(279.95KB)

赞 19