2023-09-13
This commit is contained in:
@@ -134,6 +134,16 @@ namespace FineUIPro.Web.SysManage
|
||||
{
|
||||
txtSerVerUrl.Text = sysSet9.ConstValue;
|
||||
}
|
||||
var sysSet10 = (from x in Funs.DB.Sys_Const where x.ConstText == "集团ESB地址" select x).ToList().FirstOrDefault();
|
||||
if (sysSet10 != null)
|
||||
{
|
||||
txtESBSerVerUrl.Text = sysSet10.ConstValue;
|
||||
}
|
||||
var sysSet11 = (from x in Funs.DB.Sys_Const where x.ConstText == "ClientId" select x).ToList().FirstOrDefault();
|
||||
if (sysSet11 != null)
|
||||
{
|
||||
txtClientId.Text = sysSet11.ConstValue;
|
||||
}
|
||||
var sysSet18 = BLL.ConstValue.drpConstItemList(BLL.ConstValue.Group_SafeReferer).Select(x => new { x.ConstText, x.ConstValue }).ToList();
|
||||
var txtReferer = "";
|
||||
foreach (var item in sysSet18)
|
||||
@@ -343,6 +353,48 @@ namespace FineUIPro.Web.SysManage
|
||||
Funs.DB.Sys_Const.InsertOnSubmit(newSysSet9);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
Model.Sys_Const sysSet10 = db.Sys_Const.FirstOrDefault(x => x.ConstText == "集团ESB地址");
|
||||
if (sysSet10 != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtESBSerVerUrl.Text.Trim()))
|
||||
{
|
||||
sysSet10.ConstValue = this.txtESBSerVerUrl.Text.Trim();
|
||||
}
|
||||
db.SubmitChanges();
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.Sys_Const newSysSet10 = new Model.Sys_Const();
|
||||
newSysSet10.ID = SQLHelper.GetNewID();
|
||||
if (!string.IsNullOrEmpty(this.txtESBSerVerUrl.Text.Trim()))
|
||||
{
|
||||
newSysSet10.ConstValue = this.txtESBSerVerUrl.Text.Trim();
|
||||
}
|
||||
newSysSet10.ConstText = "集团ESB地址";
|
||||
Funs.DB.Sys_Const.InsertOnSubmit(newSysSet10);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
Model.Sys_Const sysSet11 = db.Sys_Const.FirstOrDefault(x => x.ConstText == "ClientId");
|
||||
if (sysSet11 != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtClientId.Text.Trim()))
|
||||
{
|
||||
sysSet11.ConstValue = this.txtClientId.Text.Trim();
|
||||
}
|
||||
db.SubmitChanges();
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.Sys_Const newSysSet11 = new Model.Sys_Const();
|
||||
newSysSet11.ID = SQLHelper.GetNewID();
|
||||
if (!string.IsNullOrEmpty(this.txtClientId.Text.Trim()))
|
||||
{
|
||||
newSysSet11.ConstValue = this.txtClientId.Text.Trim();
|
||||
}
|
||||
newSysSet11.ConstText = "ClientId";
|
||||
Funs.DB.Sys_Const.InsertOnSubmit(newSysSet11);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
ConstValue.DeleteConstValueBygroupId(BLL.ConstValue.Group_SafeReferer);
|
||||
var q = txtRefererWhitelist.Text.Split('&');
|
||||
foreach (var item in q)
|
||||
@@ -1100,5 +1152,25 @@ namespace FineUIPro.Web.SysManage
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected void txtTestPost_OnClick(object sender, EventArgs e)
|
||||
{
|
||||
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
|
||||
string CncecEsbPath = SysConstSetService.CncecEsbPath;
|
||||
string ClientId = SysConstSetService.ClientId;
|
||||
|
||||
string baseurl = CncecEsbPath + "/cn.cncec.group.qhsePROD.common.GetToken";
|
||||
var client = new RestClient(baseurl);
|
||||
client.Timeout = -1;
|
||||
var request = new RestRequest(Method.POST);
|
||||
var thisUnit = BLL.UnitService.GetUnitByUnitId(BLL.Const.UnitId_SEDIN);
|
||||
request.AddHeader("ClientId", ClientId);
|
||||
request.AddHeader("OperationCode", "cn.cncec.group.qhsePROD.common.GetToken");
|
||||
request.AddParameter("UnitName", thisUnit.UnitName);
|
||||
request.AddParameter("CollCropCode", thisUnit.CollCropCode);
|
||||
IRestResponse response = client.Execute(request);
|
||||
|
||||
Alert.Show(response.Content);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user