style: 修改报错信息中文样式
This commit is contained in:
@@ -63,7 +63,7 @@ namespace Yi.Furion.Application.Bbs.Services.Impl
|
||||
{
|
||||
if (!await _discussRepository.IsAnyAsync(x => x.Id == discussId))
|
||||
{
|
||||
throw new UserFriendlyException(DiscussConst.主题不存在);
|
||||
throw new UserFriendlyException(DiscussConst.No_Exist);
|
||||
}
|
||||
|
||||
var entities = await _articleRepository.GetTreeAsync(x => x.DiscussId == discussId);
|
||||
@@ -82,11 +82,11 @@ namespace Yi.Furion.Application.Bbs.Services.Impl
|
||||
var discuss = await _discussRepository.GetFirstAsync(x => x.Id == input.DiscussId);
|
||||
if (discuss is null)
|
||||
{
|
||||
throw new UserFriendlyException(DiscussConst.主题不存在);
|
||||
throw new UserFriendlyException(DiscussConst.No_Exist);
|
||||
}
|
||||
if (input.ParentId != 0 && !await _repository.IsAnyAsync(x => x.Id == input.ParentId))
|
||||
{
|
||||
throw new UserFriendlyException(ArticleConst.文章不存在);
|
||||
throw new UserFriendlyException(ArticleConst.No_Exist);
|
||||
}
|
||||
await VerifyDiscussCreateIdAsync(discuss.CreatorId);
|
||||
return await base.CreateAsync(input);
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace Yi.Furion.Application.Bbs.Services.Impl
|
||||
{
|
||||
if (!await _discussRepository.IsAnyAsync(x => x.Id == input.DiscussId))
|
||||
{
|
||||
throw new UserFriendlyException(DiscussConst.主题不存在);
|
||||
throw new UserFriendlyException(DiscussConst.No_Exist);
|
||||
}
|
||||
var entity = await _forumManager.CreateCommentAsync(input.DiscussId, input.ParentId, input.RootId, input.Content);
|
||||
return await MapToGetOutputDtoAsync(entity);
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace Yi.Furion.Application.Bbs.Services.Impl
|
||||
{
|
||||
if (!await _plateEntityRepository.IsAnyAsync(x => x.Id == input.PlateId))
|
||||
{
|
||||
throw new UserFriendlyException(PlateConst.板块不存在);
|
||||
throw new UserFriendlyException(PlateConst.No_Exist);
|
||||
}
|
||||
var entity = await _forumManager.CreateDiscussAsync(await MapToEntityAsync(input));
|
||||
return await MapToGetOutputDtoAsync(entity);
|
||||
@@ -129,20 +129,20 @@ namespace Yi.Furion.Application.Bbs.Services.Impl
|
||||
var discuss = await _repository.GetFirstAsync(x => x.Id == discussId);
|
||||
if (discuss is null)
|
||||
{
|
||||
throw new UserFriendlyException(DiscussConst.主题不存在);
|
||||
throw new UserFriendlyException(DiscussConst.No_Exist);
|
||||
}
|
||||
if (discuss.PermissionType == DiscussPermissionTypeEnum.Oneself)
|
||||
{
|
||||
if (discuss.CreatorId != _currentUser.Id)
|
||||
{
|
||||
throw new UserFriendlyException(DiscussConst.私密);
|
||||
throw new UserFriendlyException(DiscussConst.Privacy);
|
||||
}
|
||||
}
|
||||
if (discuss.PermissionType == DiscussPermissionTypeEnum.User)
|
||||
{
|
||||
if (discuss.CreatorId != _currentUser.Id && !discuss.PermissionUserIds.Contains(_currentUser.Id))
|
||||
{
|
||||
throw new UserFriendlyException(DiscussConst.私密);
|
||||
throw new UserFriendlyException(DiscussConst.Privacy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,9 +40,9 @@ namespace Yi.Furion.Application.Rbac.Domain
|
||||
{
|
||||
return;
|
||||
}
|
||||
throw new UserFriendlyException(UserConst.登录失败_错误);
|
||||
throw new UserFriendlyException(UserConst.Login_Error);
|
||||
}
|
||||
throw new UserFriendlyException(UserConst.登录失败_不存在);
|
||||
throw new UserFriendlyException(UserConst.Login_User_No_Exist);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace Yi.Furion.Application.Rbac.Services.Impl
|
||||
|
||||
if (userInfo.RoleCodes.Count == 0)
|
||||
{
|
||||
throw new UserFriendlyException(UserConst.用户无角色分配);
|
||||
throw new UserFriendlyException(UserConst.No_Role);
|
||||
}
|
||||
//这里抛出一个登录的事件
|
||||
var loginLogEntity = _httpContextAccessor.HttpContext.GetLoginLogInfo();
|
||||
|
||||
@@ -85,11 +85,11 @@ namespace Yi.Furion.Application.Rbac.Services.Impl
|
||||
{
|
||||
if (string.IsNullOrEmpty(input.Password))
|
||||
{
|
||||
throw new UserFriendlyException(UserConst.添加失败_密码为空);
|
||||
throw new UserFriendlyException(UserConst.Login_Passworld_Error);
|
||||
}
|
||||
if (await _repository.IsAnyAsync(u => input.UserName.Equals(u.UserName)))
|
||||
{
|
||||
throw new UserFriendlyException(UserConst.添加失败_用户存在);
|
||||
throw new UserFriendlyException(UserConst.User_Exist);
|
||||
}
|
||||
var entities = await MapToEntityAsync(input);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user