diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/AccessLogService.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/AccessLogService.cs index 1cc27cf6..2f1c387e 100644 --- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/AccessLogService.cs +++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/AccessLogService.cs @@ -44,6 +44,21 @@ namespace Yi.Framework.Bbs.Application.Services } } + + + + /// + /// 获取全部访问流量 + /// + /// + public async Task> Get() + { + var entities = await _repository._DbQueryable.OrderBy(x => x.CreationTime).ToListAsync(); + var output = entities.Adapt>(); + output?.ForEach(x => x.CreationTime = x.CreationTime.Date); + return output; + } + /// /// 触发 /// @@ -106,5 +121,8 @@ namespace Yi.Framework.Bbs.Application.Services return result.ToArray(); } + + + } } diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Analyses/BbsUserAnalyseService.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Analyses/BbsUserAnalyseService.cs index 357d6da3..0e23cc1f 100644 --- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Analyses/BbsUserAnalyseService.cs +++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Analyses/BbsUserAnalyseService.cs @@ -93,5 +93,6 @@ namespace Yi.Framework.Bbs.Application.Services.Analyses } } + } } diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Integral/LuckyService.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Integral/LuckyService.cs index f4fed5a8..9add8bf3 100644 --- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Integral/LuckyService.cs +++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Integral/LuckyService.cs @@ -2,6 +2,8 @@ using Microsoft.AspNetCore.Authorization; using Volo.Abp.Application.Services; using Volo.Abp.EventBus.Local; +using Yi.Framework.Bbs.Application.Contracts.IServices; +using Yi.Framework.Bbs.Domain.Managers; using Yi.Framework.Bbs.Domain.Shared.Etos; namespace Yi.Framework.Bbs.Application.Services.Integral @@ -9,7 +11,8 @@ namespace Yi.Framework.Bbs.Application.Services.Integral public class LuckyService : ApplicationService { private ILocalEventBus _localEventBus; - public LuckyService(ILocalEventBus localEventBus) { _localEventBus = localEventBus; } + private BbsUserManager _bbsUserManager; + public LuckyService(ILocalEventBus localEventBus, BbsUserManager bbsUserManager) { _bbsUserManager = bbsUserManager; _localEventBus = localEventBus; } /// /// 大转盘 @@ -18,9 +21,22 @@ namespace Yi.Framework.Bbs.Application.Services.Integral [Authorize] public async Task PostWheel() { - int[] values=new int[10] { 0,10,30,50,60,80,90,100,200,666}; + var userInfo = await _bbsUserManager.GetBbsUserInfoAsync(CurrentUser.Id.Value); + if (userInfo.Money < 50) + { + throw new UserFriendlyException("钱钱不足!"); + } + + + int[] values = new int[10] { 0, 10, 30, 50, 60, 80, 90, 100, 200, 666 }; var index = GetWheelIndex(); - var value = values[index]-50; + var value = values[index] - 50; + + ////不存在负数钱钱 + //if (value < 0) + //{ + // value = 0; + //} //修改钱钱,如果钱钱不足,直接会丢出去,那本次抽奖将无效 await _localEventBus.PublishAsync(new MoneyChangeEventArgs { UserId = CurrentUser.Id!.Value, Number = value }, false); diff --git a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/AccountService.cs b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/AccountService.cs index 116d27c5..1f10b92c 100644 --- a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/AccountService.cs +++ b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/AccountService.cs @@ -269,6 +269,7 @@ namespace Yi.Framework.Rbac.Application.Services } //此处优先从缓存中获取 UserRoleMenuDto output = null; + var cacheData = await _userCache.GetAsync(new UserInfoCacheKey(userId.Value)); if (cacheData is not null) { diff --git a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Domain.Shared/Dtos/UserRoleMenuDto.cs b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Domain.Shared/Dtos/UserRoleMenuDto.cs index c4d067a2..478a51e0 100644 --- a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Domain.Shared/Dtos/UserRoleMenuDto.cs +++ b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Domain.Shared/Dtos/UserRoleMenuDto.cs @@ -18,7 +18,7 @@ namespace Yi.Framework.Rbac.Domain.Shared.Dtos /// /// 主键 /// - public Guid Id { get; protected set; } + public Guid Id { get; set; } /// /// 逻辑删除 @@ -134,7 +134,7 @@ namespace Yi.Framework.Rbac.Domain.Shared.Dtos } public class RoleDto { - public Guid Id { get; protected set; } + public Guid Id { get; set; } /// /// 逻辑删除 @@ -194,7 +194,7 @@ namespace Yi.Framework.Rbac.Domain.Shared.Dtos } public class MenuDto { - public Guid Id { get; protected set; } + public Guid Id { get; set; } /// /// 逻辑删除 diff --git a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.SqlSugarCore/Repositories/UserRepository.cs b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.SqlSugarCore/Repositories/UserRepository.cs index e51cb2ed..44279849 100644 --- a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.SqlSugarCore/Repositories/UserRepository.cs +++ b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.SqlSugarCore/Repositories/UserRepository.cs @@ -33,7 +33,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore.Repositories var user = await _DbQueryable.Includes(u => u.Roles.Where(r => r.IsDeleted == false).ToList(), r => r.Menus.Where(m => m.IsDeleted == false).ToList()).InSingleAsync(userId); if (user is null) { - throw new ArgumentNullException($"参数错误,用户id:{nameof(userId)} 不存在"); + throw new UserFriendlyException($"数据错误,用户id:{nameof(userId)} 不存在,请重新登录"); } user.Password = string.Empty; user.Salt = string.Empty; diff --git a/Yi.Bbs.Vue3/src/apis/accessApi.js b/Yi.Bbs.Vue3/src/apis/accessApi.js index 8506ccf5..cbbcf2cc 100644 --- a/Yi.Bbs.Vue3/src/apis/accessApi.js +++ b/Yi.Bbs.Vue3/src/apis/accessApi.js @@ -15,3 +15,10 @@ export function getWeek() { method: "get", }); } +// 获取全部数据 +export function getAccessList() { + return request({ + url: "/access-log", + method: "get", + }); +} diff --git a/Yi.Bbs.Vue3/src/assets/atom-one-dark.css b/Yi.Bbs.Vue3/src/assets/atom-one-dark.css new file mode 100644 index 00000000..1616aafe --- /dev/null +++ b/Yi.Bbs.Vue3/src/assets/atom-one-dark.css @@ -0,0 +1,96 @@ +/* + +Atom One Dark by Daniel Gamage +Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax + +base: #282c34 +mono-1: #abb2bf +mono-2: #818896 +mono-3: #5c6370 +hue-1: #56b6c2 +hue-2: #61aeee +hue-3: #c678dd +hue-4: #98c379 +hue-5: #e06c75 +hue-5-2: #be5046 +hue-6: #d19a66 +hue-6-2: #e6c07b + +*/ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + color: #abb2bf; + background: #282c34; +} + +.hljs-comment, +.hljs-quote { + color: #5c6370; + font-style: italic; +} + +.hljs-doctag, +.hljs-keyword, +.hljs-formula { + color: #c678dd; +} + +.hljs-section, +.hljs-name, +.hljs-selector-tag, +.hljs-deletion, +.hljs-subst { + color: #e06c75; +} + +.hljs-literal { + color: #56b6c2; +} + +.hljs-string, +.hljs-regexp, +.hljs-addition, +.hljs-attribute, +.hljs-meta-string { + color: #98c379; +} + +.hljs-built_in, +.hljs-class .hljs-title { + color: #e6c07b; +} + +.hljs-attr, +.hljs-variable, +.hljs-template-variable, +.hljs-type, +.hljs-selector-class, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-number { + color: #d19a66; +} + +.hljs-symbol, +.hljs-bullet, +.hljs-link, +.hljs-meta, +.hljs-selector-id, +.hljs-title { + color: #61aeee; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} + +.hljs-link { + text-decoration: underline; +} diff --git a/Yi.Bbs.Vue3/src/components/ArticleContentInfo.vue b/Yi.Bbs.Vue3/src/components/ArticleContentInfo.vue index 2dd7ab06..4a2f74b2 100644 --- a/Yi.Bbs.Vue3/src/components/ArticleContentInfo.vue +++ b/Yi.Bbs.Vue3/src/components/ArticleContentInfo.vue @@ -1,3 +1,71 @@ +