From 9f2d3808972aa9736d9ba83cf9fbca18fbfec750 Mon Sep 17 00:00:00 2001 From: Tyrone CT Date: Wed, 15 Apr 2026 17:32:39 +0800 Subject: [PATCH] =?UTF-8?q?IP=E5=92=8C=E8=B7=AF=E5=BE=84=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BA=86=E5=8F=AF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MoviconHub.App/App.config | 2 ++ MoviconHub.App/Services/ApiHelper.cs | 7 ++++++- MoviconHub.App/Services/ApiService.cs | 9 ++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/MoviconHub.App/App.config b/MoviconHub.App/App.config index 6765931..364d977 100644 --- a/MoviconHub.App/App.config +++ b/MoviconHub.App/App.config @@ -7,6 +7,8 @@ + + diff --git a/MoviconHub.App/Services/ApiHelper.cs b/MoviconHub.App/Services/ApiHelper.cs index 5dfdf1c..b6da06d 100644 --- a/MoviconHub.App/Services/ApiHelper.cs +++ b/MoviconHub.App/Services/ApiHelper.cs @@ -1,6 +1,7 @@ using MoviconHub.App.Com; using MoviconHub.App.Models; using System; +using System.Configuration; using System.Collections.Generic; using System.Linq; using System.Text; @@ -20,7 +21,11 @@ namespace MoviconHub.App.Services { //_apiConfig = ApiConfig.LoadConfig(); //string baseUrl = $"http://{_apiConfig.ServerAddress}:{_apiConfig.ServerPort}/"; - string baseUrl = $"http://172.16.3.203:8000"; + string baseUrl = ConfigurationManager.AppSettings["ApiBaseUrl"]; + if (string.IsNullOrWhiteSpace(baseUrl)) + { + baseUrl = "http://172.16.3.203:8000"; + } _apiService = new ApiService(baseUrl); } diff --git a/MoviconHub.App/Services/ApiService.cs b/MoviconHub.App/Services/ApiService.cs index 6c593d4..aab6b38 100644 --- a/MoviconHub.App/Services/ApiService.cs +++ b/MoviconHub.App/Services/ApiService.cs @@ -3,6 +3,7 @@ using Newtonsoft.Json; using NLog; using RestSharp; using System; +using System.Configuration; using System.Collections.Generic; using System.Linq; using System.Text; @@ -49,7 +50,13 @@ namespace MoviconHub.App.Services { try { - var request = new RestRequest("/mes/order/iotPartInfo/getPartInfo", Method.Get); + string resource = ConfigurationManager.AppSettings["ApiGetPartInfoPath"]; + if (string.IsNullOrWhiteSpace(resource)) + { + resource = "/mes/order/iotPartInfo/getPartInfo"; + } + + var request = new RestRequest(resource, Method.Get); request.AddParameter("PartQRCodeId", partQrCodeId); //request.AddParameter("DeviceCode", deviceCode);