IP和路径增加了可配置
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
<add key="connecting1" value="Data Source=192.168.40.2;user instance=false;Initial Catalog=DissColorMachine;User ID=sa;Password=ABCabc123" />
|
||||
<add key="connecting" value="Data Source=CT-PC;user instance=false;Initial Catalog=MoviconDb;User ID=sa;Password=12345678" />
|
||||
<add key="RemoteConnecting" value="Data Source=CT-PC;user instance=false;Initial Catalog=MoviconDb;User ID=sa;Password=12345678" />
|
||||
<add key="ApiBaseUrl" value="http://172.16.3.203:8000" />
|
||||
<add key="ApiGetPartInfoPath" value="/mes/order/iotPartInfo/getPartInfo" />
|
||||
<add key="PLCIP" value="127.0.0.1" />
|
||||
<add key="PLCPort" value="6000" />
|
||||
<add key="PLCScan" value="600" />
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user