merge from 2023-03-14

This commit is contained in:
2023-03-24 09:37:07 +08:00
parent f95ef4cf73
commit 3de92dab06
57 changed files with 1538 additions and 528 deletions

View File

@@ -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);