|
@@ -70,10 +70,22 @@ namespace WingDeviceService.Service
|
|
|
var deviceDto = await _deviceInfoDBServiceProxy.FindDeviceInfoBySerialNumberAsync(request.DeviceUniqueCode);
|
|
|
var shortCode = deviceDto?.ShortCode;
|
|
|
var deviceCode = deviceDto?.DeviceCode;
|
|
|
+ var deviceName = deviceDto?.Name;
|
|
|
if (string.IsNullOrWhiteSpace(shortCode))
|
|
|
{
|
|
|
shortCode = GenerateShortCode();
|
|
|
}
|
|
|
+ if (string.IsNullOrWhiteSpace(deviceName))
|
|
|
+ {
|
|
|
+ if (deviceDto == null && !string.IsNullOrWhiteSpace(request.Name))
|
|
|
+ {
|
|
|
+ deviceName = request.Name;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ deviceName = shortCode;
|
|
|
+ }
|
|
|
+ }
|
|
|
if (deviceDto == null)
|
|
|
{
|
|
|
var deviceInfoDB = new DeviceInfoDTO()
|
|
@@ -113,7 +125,7 @@ namespace WingDeviceService.Service
|
|
|
};
|
|
|
await _organizationDBService.CreateOrganizationsAsync(new CreateOrganizationsDBRequest { Infos = new List<TableDataItem<OrganizationDTO>> { orgData } });
|
|
|
}
|
|
|
- var applyRequest = new ApplyTokenRequest(AccountType.US, request.Name,request.Platform, request.LoginSource, deviceCode, _sourceUrl, 0);
|
|
|
+ var applyRequest = new ApplyTokenRequest(AccountType.US, deviceName, request.Platform, request.LoginSource, deviceCode, _sourceUrl, 0);
|
|
|
var tokenInfo = await _authenticationService.ApplyTokenAsync(applyRequest);
|
|
|
return new ConnectResult
|
|
|
{
|