优化登出接口
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user