diff --git a/Admin.Bodk.Device/Entities/Dto/SupportDto.cs b/Admin.Bodk.Device/Entities/Dto/SupportDto.cs index c654d7b..faeac4a 100644 --- a/Admin.Bodk.Device/Entities/Dto/SupportDto.cs +++ b/Admin.Bodk.Device/Entities/Dto/SupportDto.cs @@ -27,6 +27,7 @@ public class SupportOutput public class CellOutput { + public string Code { get; set; } public string Activity { get; set; } public double Temperature { get; set; } public string Humidity { get; set; } diff --git a/Admin.Bodk.Device/Services/DeviceService.cs b/Admin.Bodk.Device/Services/DeviceService.cs index bf2ca74..e02fb2e 100644 --- a/Admin.Bodk.Device/Services/DeviceService.cs +++ b/Admin.Bodk.Device/Services/DeviceService.cs @@ -7,6 +7,8 @@ using Furion.DependencyInjection; using Furion.DynamicApiController; using Furion.FriendlyException; using Mapster; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using SqlSugar; @@ -34,6 +36,8 @@ public class DeviceService : IDynamicApiController, ITransient /// /// [DisplayName("获取设备列表")] + + [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme + "," + SignatureAuthenticationDefaults.AuthenticationScheme)] public async Task> PostList(DeviceInpt input) { return await _repository.AsQueryable() diff --git a/Admin.Bodk.Device/Services/SupportService.cs b/Admin.Bodk.Device/Services/SupportService.cs index 4608126..de655ac 100644 --- a/Admin.Bodk.Device/Services/SupportService.cs +++ b/Admin.Bodk.Device/Services/SupportService.cs @@ -54,12 +54,12 @@ public class SupportService: IDynamicApiController, ITransient public async Task> PostGetCellList(BaseInput input) { List items = new List(); - items.Add( new CellOutput() {Activity="51%",Temperature = -192.5, Humidity = "12.1%", - Density="20个/ml", Capacity="200ml", Type= 1, Location="松山湖",LastOperationTime=null, + items.Add( new CellOutput() {Code="BT00D0015314A",Activity="98%",Temperature = -192.5, Humidity = "0.5%", + Density="1*10^7个/ml", Capacity="1.8ml", Type= 1, Location="松山湖",LastOperationTime=null, DeviceInfo=new DeviceInfo() { - DeviceId=23223232,PicUrl="",LiquidNitrogenHeight=302,Temperature=-195.2, - Humidity="10%",Address="广东省东莞市科技二路与科技一路交叉口西北角宏远·新智汇1栋", + DeviceId=23223232,PicUrl="",LiquidNitrogenHeight=180,Temperature=-195.2, + Humidity="0.5%",Address="广东省东莞市松山湖园区科技二路宏远新智汇1栋", Name="M9_01",CellBaseInfo=new CellBaseInfo(){BaseName="松山湖",BaseId=13545} } }); diff --git a/Admin.NET.Core/SeedData/SysRoleMenuSeedData.cs b/Admin.NET.Core/SeedData/SysRoleMenuSeedData.cs index a3ce2a6..a91d1e9 100644 --- a/Admin.NET.Core/SeedData/SysRoleMenuSeedData.cs +++ b/Admin.NET.Core/SeedData/SysRoleMenuSeedData.cs @@ -15,9 +15,10 @@ public class SysRoleMenuSeedData : ISqlSugarEntitySeedData return new[] { // 数据面板【admin/1300000000101】 - new SysRoleMenu{ Id=1300000000101, RoleId=1300000000101, MenuId=1300000000101 }, + new SysRoleMenu{ Id=1300000000101, RoleId=1300000000101, MenuId=35482331532101 }, new SysRoleMenu{ Id=1300000000102, RoleId=1300000000101, MenuId=1300000000111 }, - new SysRoleMenu{ Id=1300000000103, RoleId=1300000000101, MenuId=1300000000121 }, + new SysRoleMenu{ Id=1300000000103, RoleId=1300000000101, MenuId=35397279041861 }, + new SysRoleMenu{ Id=1300000000104, RoleId=1300000000101, MenuId=35571166242117 }, // 系统管理 new SysRoleMenu{ Id=1300000000111, RoleId=1300000000101, MenuId=1310000000101 }, diff --git a/Admin.NET.Core/SeedData/SysUserSeedData.cs b/Admin.NET.Core/SeedData/SysUserSeedData.cs index d2207d7..40005cf 100644 --- a/Admin.NET.Core/SeedData/SysUserSeedData.cs +++ b/Admin.NET.Core/SeedData/SysUserSeedData.cs @@ -1,13 +1,10 @@ -// 大名科技(天津)有限公司版权所有 电话:18020030720 QQ:515096995 -// -// 此源代码遵循位于源代码树根目录中的 LICENSE 文件的许可证 namespace Admin.NET.Core; /// /// 系统用户表种子数据 /// -public class SysUserSeedData : ISqlSugarEntitySeedData +public class SysUserSeedData { /// /// 种子数据 @@ -16,6 +13,7 @@ public class SysUserSeedData : ISqlSugarEntitySeedData public IEnumerable HasData() { var encryptPassword = CryptogramUtil.Encrypt("123456"); + var encryptPassword2 = CryptogramUtil.Encrypt("liuzhaoqiang"); return new[] { @@ -25,6 +23,7 @@ public class SysUserSeedData : ISqlSugarEntitySeedData new SysUser{ Id=1300000000113, Account="zhangzhuo", Password=encryptPassword, NickName="张卓", RealName="部门职员", Phone="18020030720", Birthday=DateTime.Parse("2000-01-01"), Sex=GenderEnum.Female, AccountType=AccountTypeEnum.NormalUser, Remark="部门职员", CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrgId=1300000000103, PosId=1300000000110, TenantId=1300000000001 }, new SysUser{ Id=1300000000114, Account="huangzhifeng", Password=encryptPassword, NickName="黄志风", RealName="普通用户", Phone="18020030720", Birthday=DateTime.Parse("2000-01-01"), Sex=GenderEnum.Female, AccountType=AccountTypeEnum.NormalUser, Remark="普通用户", CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrgId=1300000000104, PosId=1300000000115, TenantId=1300000000001 }, new SysUser{ Id=1300000000115, Account="shikunpeng", Password=encryptPassword, NickName="史鲲鹏", RealName="其他", Phone="18020030720", Birthday=DateTime.Parse("2000-01-01"), Sex=GenderEnum.Female, AccountType=AccountTypeEnum.Member, Remark="会员", CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrgId=1300000000105, PosId=1300000000116, TenantId=1300000000001 }, + new SysUser{ Id=1300000000116, Account="liuzhaoqiang", Password=encryptPassword2, NickName="刘总", RealName="刘照强", Phone="18020030720", Birthday=DateTime.Parse("2000-01-01"), Sex=GenderEnum.Female, AccountType=AccountTypeEnum.Member, Remark="超级管理员", CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrgId=1300000000106, PosId=1300000000117, TenantId=1300000000001 }, }; } } \ No newline at end of file diff --git a/Admin.NET.Core/Service/Role/SysRoleService.cs b/Admin.NET.Core/Service/Role/SysRoleService.cs index 3955eec..e15ade4 100644 --- a/Admin.NET.Core/Service/Role/SysRoleService.cs +++ b/Admin.NET.Core/Service/Role/SysRoleService.cs @@ -91,7 +91,8 @@ public class SysRoleService : IDynamicApiController, ITransient return; // 将父节点为0的菜单排除,防止前端全选异常 - var pMenuIds = await _sysRoleRep.ChangeRepository>().AsQueryable().Where(u => input.MenuIdList.Contains(u.Id) && u.Pid == 0).ToListAsync(u => u.Id); + //var pMenuIds = await _sysRoleRep.ChangeRepository>().AsQueryable().Where(u => input.MenuIdList.Contains(u.Id) && u.Pid == 0).ToListAsync(u => u.Id); + var pMenuIds = await _sysRoleRep.ChangeRepository>().AsQueryable().Where(u => input.MenuIdList.Contains(u.Id)).ToListAsync(u => u.Id); var menuIds = input.MenuIdList.Except(pMenuIds); // 差集 await GrantMenu(new RoleMenuInput() { diff --git a/Admin.NET.Web.Entry/Admin.NET.db b/Admin.NET.Web.Entry/Admin.NET.db index 4d9893e..2b67c14 100644 Binary files a/Admin.NET.Web.Entry/Admin.NET.db and b/Admin.NET.Web.Entry/Admin.NET.db differ