//从这里开始复制 #region 返回变量区禁止修改 //认证结果返回值(请不要修改) var returnValue = ""; //返回的状态(请不要修改) int result = 1; //返回认证的令牌(没有为空即可) string token = ""; #endregion try { var account = Account; var passWord = PassWord; var iPaddress = IPAddress; #region 认证逻辑区 if (!string.IsNullOrEmpty(account)&&!string.IsNullOrEmpty(passWord)) { string url = "http://192.168.106.99:9010/api/AuthUser/ApiGetAuthInfo"; Dictionary pairs = new Dictionary(); pairs["account"] = account; pairs["password"] = passWord; pairs["password2"] = ""; pairs["AuthUrl"] = "https://192.168.106.198/sdd/api/thirdParty/authClientUser"; pairs["ItgUrl"] = "192.168.106.99"; pairs["ItgPort"] = "80"; pairs["IntegrationKey"] = "72eb86e2-1f46-42ea-b918-4e58e5d4a570"; var resultJson = EDoc2.Common.IntegrationRequest.WebApiPost(url, pairs, System.Text.Encoding.UTF8, "application/json"); if (!string.IsNullOrEmpty(resultJson)) { Dictionary pairsResult = Newtonsoft.Json.JsonConvert.DeserializeObject>(resultJson); if (pairsResult.ContainsKey("code")) { if (Convert.ToInt32(pairsResult["code"]) == 0) { result = 0; } else if (Convert.ToInt32(pairsResult["code"]) == 22000) { result = 5; } else { result = 1; } } else { result = 2; } } } else { string url = "http://192.168.106.99/api/services/Org/UserLoginIntegrationByUserLoginName"; Dictionary pairs = new Dictionary(); pairs["LoginName"] = account; pairs["IPAddress"] = iPaddress; pairs["IntegrationKey"] = "72eb86e2-1f46-42ea-b918-4e58e5d4a570"; var resultJson = EDoc2.Common.IntegrationRequest.WebApiPost(url, pairs, System.Text.Encoding.UTF8, "application/json"); if (!string.IsNullOrEmpty(resultJson)) { Dictionary pairsResult = Newtonsoft.Json.JsonConvert.DeserializeObject>(resultJson); if (pairsResult.ContainsKey("result")) { if (Convert.ToInt32(pairsResult["result"]) == 0) { result = 0; } else { result = 1; } } else { result = 2; } } } #endregion } catch (Exception ex) { //程序出错将输出3(请不要修改) result = 3; token = ex.Message; } #region 返回输出区禁止修改 //设置cookies有效时间一天 //分割方式输出 returnValue = result + "|" + token; #endregion //从这里复制结束