优化登出接口

This commit is contained in:
tongfei
2024-01-08 10:25:27 +08:00
parent 73c511ead8
commit 2596ac58ed
11 changed files with 228 additions and 112 deletions

View File

@@ -86,6 +86,26 @@ namespace WMS.Web.Domain.Services.Public
}
}
public async Task<Result<string>> Init1()
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = int.MaxValue;
binding.SendTimeout = new TimeSpan(int.MaxValue);
EndpointAddress address = new EndpointAddress(this._erpOptions.EndpointAddress);
this._client = new ERPGWSoapClient(binding, address);
try
{
var result = await this._client.ValidateSystemAsync(this._erpOptions.UserName, this._erpOptions.Password, "Orico", "");
if (result == null)
return Result<string>.ReFailure(ResultCodes.Erp_Login_Error);
return Result<string>.ReSuccess(result.AccessToken);
}
catch (Exception ex)
{
return Result<string>.ReFailure(ResultCodes.Erp_Login_Error);
}
}
/// <summary>
/// 查单据类型的值
/// </summary>
@@ -95,7 +115,7 @@ namespace WMS.Web.Domain.Services.Public
try
{
//1.先登录金蝶-拿到token
var token_result = await this.Init();
var token_result = await this.Init1();
if (!token_result.IsSuccess)
return ResultList<ErpBaseDto>.ReFailure(token_result);