提交 a851c433 编写于 作者: 麦壳饼's avatar 麦壳饼

modify for register.vue and login/index.vue

上级 4bc3ae9a
......@@ -49,18 +49,19 @@ namespace IoTSharp.Controllers
{
string custid = _signInManager.Context.User.FindFirstValue(IoTSharpClaimTypes.Customer);
var user = await _userManager.GetUserAsync(_signInManager.Context.User);
var Customer = _context.Customer.FirstOrDefault(c => c.Id.ToString() == custid);
var Customer = _context.Customer.Include(c=>c.Tenant).FirstOrDefault(c => c.Id.ToString() == custid);
var rooles= await _userManager.GetRolesAsync(user );
var uidto = new UserInfoDto()
{
Code = ApiCode.OK,
Roles = string.Join(',',rooles).ToLower().Contains("admin")?"admin":"editor",//TODO: Permission control
Roles = string.Join(',',rooles).ToLower().Contains("admin")?"admin": "admin",//TODO: Permission control
Name = user.UserName,
Email = user.Email,
Avatar = user.Gravatar(),
Introduction = user.NormalizedUserName,
Customer = Customer,
Tenant = Customer.Tenant
Tenant = Customer?.Tenant
};
return new ApiResult<UserInfoDto>(ApiCode.Success, "OK", uidto);
}
......
......@@ -15,5 +15,6 @@ namespace IoTSharp.Dtos
public string Introduction { get; set; }
public Customer Customer { get; set; }
public Tenant Tenant { get; set; }
public string Email { get; set; }
}
}
\ No newline at end of file
......@@ -11,11 +11,9 @@
<Product>IoTSharp</Product>
<Authors>IoT#</Authors>
<PackageProjectUrl>https://github.com/IoTSharp/IoTSharp</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/IoTSharp/IoTSharp/blob/master/LICENSE</PackageLicenseUrl>
<PackageLicenseUrl></PackageLicenseUrl>
<RepositoryUrl>https://github.com/IoTSharp/IoTSharp</RepositoryUrl>
<PackageReleaseNotes>
Open-source IoT Platform - Device management, data collection, processing and visualization. https://www.iotsharp.net
</PackageReleaseNotes>
<PackageReleaseNotes>Open-source IoT Platform - Device management, data collection, processing and visualization. https://www.iotsharp.net</PackageReleaseNotes>
<Description>Open-source IoT Platform - Device management, data collection, processing and visualization.</Description>
<PackageId>IoTSharp</PackageId>
<UserSecretsId>18970590-05bf-4a1f-a70b-3c8a120d12cb</UserSecretsId>
......@@ -27,6 +25,11 @@
<!-- Set this to true if you enable server-side prerendering -->
<BuildServerSideRenderer>false</BuildServerSideRenderer>
<Version>0.1.99</Version>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<RepositoryType>git</RepositoryType>
<PackageTags>IoT</PackageTags>
<PackageIconUrl>https://avatars2.githubusercontent.com/u/44353254?s=200&amp;v=4</PackageIconUrl>
</PropertyGroup>
<ItemGroup>
<Content Update="appsettings.json">
......@@ -55,6 +58,10 @@
<Content Remove="Migrations\**" />
<EmbeddedResource Remove="Migrations\**" />
<None Remove="Migrations\**" />
<None Include="..\LICENSE.txt">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Changwei.AspNetCore.SpaServices.Extensions.VueCli" Version="1.0.0" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册