上传系统接口增加token

This commit is contained in:
hehaibing-1996
2025-03-03 11:23:07 +08:00
parent bd8337bed2
commit 84aa11ef30
4 changed files with 81 additions and 16 deletions

View File

@ -12,6 +12,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using WCS.BLL;
using WCS.BLL.Config;
using WCS.Model;
namespace WCS.BLL.Tool
@ -280,6 +281,7 @@ namespace WCS.BLL.Tool
if (isSaveLog)
Logs.Write($"【{guid}】开始请求调用接口 url{url} 请求方式:{httpMethod} 数据:{data}", LogsType.Api);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Headers.Add("token",LocalStatic.WMSToken);//智能制造要求请求增加token
request.Method = httpMethod;
request.ContentType = "application/json";
request.Timeout = 10000;
@ -324,7 +326,7 @@ namespace WCS.BLL.Tool
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = httpMethod;
request.ContentType = "application/json";
request.Timeout = 2000;
request.Timeout = 3000;
if (!string.IsNullOrEmpty(data))
{