merge from 2023-03-14
This commit is contained in:
@@ -474,6 +474,13 @@ public class UsersCurrentService : IUsersCurrentService, IDynamicApiController,
|
||||
}
|
||||
else
|
||||
{
|
||||
// 当前系统已被管理员禁用.
|
||||
var switchSystem = await _repository.AsSugarClient().Queryable<SystemEntity>()
|
||||
.Where(it => input.majorId.Equals(it.Id) && it.DeleteMark == null)
|
||||
.FirstAsync();
|
||||
if (switchSystem != null && !switchSystem.EnabledMark.Equals(1))
|
||||
throw Oops.Oh(ErrorCode.D4014);
|
||||
|
||||
// 系统下没有菜单不允许切换.
|
||||
var mList = await _repository.AsSugarClient().Queryable<ModuleEntity>().Where(x => x.SystemId.Equals(input.majorId) && x.DeleteMark == null && x.Category.Equals("Web")).Select(x => x.Id).ToListAsync();
|
||||
if (!mList.Any()) throw Oops.Oh(ErrorCode.D4009);
|
||||
|
||||
Reference in New Issue
Block a user