From df103b2abe49e4eb2050bf51f0d2df3822344709 Mon Sep 17 00:00:00 2001 From: liangjunyu <13726812+shifang-tianhua_0@user.noreply.gitee.com> Date: Sat, 18 Oct 2025 18:05:39 +0800 Subject: [PATCH] 1 --- Controllers/EnpowerApiController.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 {