update ZR.Service/System/SysMenuService.cs.

菜单管理查询为空时报错,增加了查询为空时返回一个默认值;

Signed-off-by: xbzhu <5430389+xbzhu@user.noreply.gitee.com>
This commit is contained in:
xbzhu 2023-01-21 06:36:40 +00:00 committed by Gitee
parent 0bf43fe33a
commit 65da38a91d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1,4 +1,4 @@
using Infrastructure.Attribute; using Infrastructure.Attribute;
using Infrastructure.Extensions; using Infrastructure.Extensions;
using SqlSugar; using SqlSugar;
using System; using System;
@ -41,7 +41,7 @@ namespace ZR.Service
var userRoles = SysRoleService.SelectUserRoles(userId); var userRoles = SysRoleService.SelectUserRoles(userId);
menuList = SelectTreeMenuListByRoles(menu, userRoles); menuList = SelectTreeMenuListByRoles(menu, userRoles);
} }
return menuList; return menuList ?? new List<SysMenu>();
} }
/// <summary> /// <summary>