diff --git a/Controllers/EnpowerApiController.cs b/Controllers/EnpowerApiController.cs index 1a6b3fb..2ca53e1 100644 --- a/Controllers/EnpowerApiController.cs +++ b/Controllers/EnpowerApiController.cs @@ -1067,9 +1067,22 @@ namespace RB_MES_API.Controllers string setPort = ApiSettingsHelper.GetConfig($"{formid}_Port"); if (!setPort.IsNullOrEmpty()) { + string acctid = ApiSettingsHelper.GetConfig("X-KDApi-AcctID"); + string appid = ApiSettingsHelper.GetConfig("X-KDApi-AppID"); + string sppsec = ApiSettingsHelper.GetConfig("X-KDApi-AppSec"); + string usname = ApiSettingsHelper.GetConfig("X-KDApi-UserName"); + int lcid = 0; + int.TryParse(ApiSettingsHelper.GetConfig("X-KDApi-LCID"), out lcid); string serverUrl = ApiSettingsHelper.GetConfig("X-KDApi-ServerUrl"); + string orgno = LocalStaticRequest.GetSystemProfile(2, "DefaultORG"); + serverUrl = ReplaceOrAddPortAdvanced(serverUrl, setPort); - result = new K3CloudApi(serverUrl).BatchSave(formid, jsonstr); + //serverUrl = serverUrl.Replace("k3cloud/",""); + K3CloudApi k3CloudApi = new K3CloudApi(serverUrl); + LogHelper.WriteLog($"云星空API地址 {formid} : {serverUrl}"); + + k3CloudApi.InitClient(acctid, appid, sppsec, usname, lcid, orgno, serverUrl); + result = k3CloudApi.BatchSave(formid, jsonstr); } else {