diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Notice/BbsNoticeGetListInputVo.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Notice/BbsNoticeGetListInputVo.cs
new file mode 100644
index 00000000..866dcbbc
--- /dev/null
+++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Notice/BbsNoticeGetListInputVo.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Volo.Abp.Application.Dtos;
+using Yi.Framework.Ddd.Application.Contracts;
+
+namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Notice
+{
+ public class BbsNoticeGetListInputVo:PagedAllResultRequestDto
+ {
+ }
+}
diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Notice/BbsNoticeGetListOutputDto.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Notice/BbsNoticeGetListOutputDto.cs
new file mode 100644
index 00000000..c464ab0b
--- /dev/null
+++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Notice/BbsNoticeGetListOutputDto.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Yi.Framework.Bbs.Domain.Shared.Enums;
+
+namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Notice
+{
+ public class BbsNoticeGetListOutputDto
+ {
+ ///
+ /// 消息,支持html
+ ///
+ public string Message { get; set; }
+
+ ///
+ /// 消息类型
+ ///
+ public NoticeTypeEnum NoticeType { get; }
+
+ ///
+ /// 是否已读
+ ///
+ public bool IsRead { get; private set; }
+
+ ///
+ /// 已读时间
+ ///
+ public DateTime? ReadTime { get; private set; }
+
+ ///
+ /// 消息创建时间
+ ///
+ public DateTime CreationTime { get; }
+ }
+}
diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/BbsNoticeService.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/BbsNoticeService.cs
new file mode 100644
index 00000000..562593b2
--- /dev/null
+++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/BbsNoticeService.cs
@@ -0,0 +1,72 @@
+using Mapster;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using SqlSugar;
+using Volo.Abp.Application.Dtos;
+using Volo.Abp.Application.Services;
+using Yi.Framework.Bbs.Application.Contracts.Dtos.Notice;
+using Yi.Framework.Bbs.Domain.Entities;
+using Yi.Framework.SqlSugarCore.Abstractions;
+
+namespace Yi.Framework.Bbs.Application.Services
+{
+ public class BbsNoticeService : ApplicationService
+ {
+ private ISqlSugarRepository _repository;
+ public BbsNoticeService(ISqlSugarRepository repository)
+ {
+ _repository = repository;
+ }
+
+
+ ///
+ /// 查询用户的消息,需登录
+ ///
+ ///
+ ///
+ ///
+ [Authorize]
+ public async Task> GetListAsync(BbsNoticeGetListInputVo input)
+ {
+ RefAsync total = 0;
+ var entities = await _repository._DbQueryable.Where(x => x.AcceptUserId == CurrentUser.Id)
+ .OrderByDescending(x => x.CreationTime)
+ .ToPageListAsync(input.SkipCount, input.MaxResultCount, total);
+
+ var output = entities.Adapt>();
+ return new PagedResultDto(total, output);
+ }
+
+ ///
+ /// 已读消息,不传guid,代表一键已读,需登录
+ ///
+ ///
+ [Authorize]
+ [Route("bbs-notice/read/{noticeId?}")]
+ public async Task PutReadAsync(Guid? noticeId)
+ {
+ //一键已读
+ if (noticeId is null)
+ {
+ await _repository._Db.Updateable()
+ .SetColumns(it => it.IsRead == true)
+ .Where(x => x.AcceptUserId == CurrentUser.Id)
+ .Where(x => x.IsRead == false)
+ .ExecuteCommandAsync();
+ }
+ //已读一条
+ else
+ {
+ await _repository._Db.Updateable()
+ .SetColumns(it => it.IsRead == true)
+ .Where(x => x.AcceptUserId == CurrentUser.Id)
+ .Where(x => x.IsRead == false)
+ .Where(x => x.Id == noticeId)
+ .ExecuteCommandAsync();
+
+ }
+
+ }
+
+ }
+}
diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Forum/AgreeService.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Forum/AgreeService.cs
index 737b3a76..de20e651 100644
--- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Forum/AgreeService.cs
+++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Forum/AgreeService.cs
@@ -29,7 +29,6 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
/// Todo: 可放入领域层
///
///
- [UnitOfWork]
[Authorize]
public async Task PostOperateAsync(Guid discussId)
{
@@ -53,9 +52,8 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
}
else
{
-
//点赞过,删除即可,修改总点赞数量
- await _repository.DeleteByIdAsync(entity.Id);
+ await _repository.DeleteAsync(entity);
var discussEntity = await _discssRepository.GetByIdAsync(discussId);
if (discussEntity is null)
{
diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain.Shared/Consts/DiscussConst.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain.Shared/Consts/DiscussConst.cs
index bd90b72f..b29d6c4a 100644
--- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain.Shared/Consts/DiscussConst.cs
+++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain.Shared/Consts/DiscussConst.cs
@@ -15,5 +15,9 @@ namespace Yi.Framework.Bbs.Domain.Shared.Consts
public const string No_Exist = "传入的主题id不存在";
public const string Privacy = "【私密】您无该主题权限,可联系作者申请开放";
+
+ public const string AgreeNotice = "您的主题[{0}]被[{1}]用户点赞!得到一致认可,发现宝藏内容!";
+
+ public const string CommentNotice = "您的主题[{0}]被[{1}]用户评论!评论内容:[{2}]。。。";
}
}
diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain.Shared/Model/HubUserModel.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain.Shared/Model/HubUserModel.cs
new file mode 100644
index 00000000..d23a6d9d
--- /dev/null
+++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain.Shared/Model/HubUserModel.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Yi.Framework.Bbs.Domain.Shared.Model
+{
+ ///
+ /// 消息通知存储用户信息
+ ///
+ public class HubUserModel
+ {
+ public HubUserModel(string connnectionId,Guid userId)
+ {
+ ConnnectionId = connnectionId;
+ UserId = userId;
+ }
+
+ ///
+ /// 客户端连接Id
+ ///
+ public string? ConnnectionId { get; }
+ ///
+ /// 用户id
+ ///
+ public Guid? UserId { get; set; }
+ }
+}
diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/Entities/BbsNoticeAggregateRoot.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/Entities/BbsNoticeAggregateRoot.cs
index a1d276cf..cf6180c3 100644
--- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/Entities/BbsNoticeAggregateRoot.cs
+++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/Entities/BbsNoticeAggregateRoot.cs
@@ -8,6 +8,10 @@ namespace Yi.Framework.Bbs.Domain.Entities
[SugarTable("BbsNotice")]
public class BbsNoticeAggregateRoot : AggregateRoot, IHasCreationTime
{
+ public BbsNoticeAggregateRoot()
+ {
+
+ }
public BbsNoticeAggregateRoot(NoticeTypeEnum noticeType, string message, Guid? acceptUserId = null)
{
this.NoticeType = noticeType;
@@ -47,7 +51,7 @@ namespace Yi.Framework.Bbs.Domain.Entities
///
public DateTime? ReadTime { get; private set; }
- public DateTime CreationTime { get; }
+ public DateTime CreationTime { get; set; }
}
diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/EventHandlers/AgreeChangedEventHandler.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/EventHandlers/AgreeChangedEventHandler.cs
index 3a56a6ef..58a0cb2d 100644
--- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/EventHandlers/AgreeChangedEventHandler.cs
+++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/EventHandlers/AgreeChangedEventHandler.cs
@@ -1,8 +1,12 @@
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events;
using Volo.Abp.EventBus;
+using Volo.Abp.EventBus.Local;
using Yi.Framework.Bbs.Domain.Entities;
using Yi.Framework.Bbs.Domain.Entities.Forum;
+using Yi.Framework.Bbs.Domain.Shared.Consts;
+using Yi.Framework.Bbs.Domain.Shared.Etos;
+using Yi.Framework.Rbac.Domain.Entities;
using Yi.Framework.SqlSugarCore.Abstractions;
namespace Yi.Framework.Bbs.Domain.EventHandlers
@@ -13,49 +17,70 @@ namespace Yi.Framework.Bbs.Domain.EventHandlers
public class AgreeCreatedEventHandler : ILocalEventHandler>,
ITransientDependency
{
- private ISqlSugarRepository _userRepository;
+ private ISqlSugarRepository _userRepository;
+ private ISqlSugarRepository _userInfoRepository;
private ISqlSugarRepository _agreeRepository;
- public AgreeCreatedEventHandler(ISqlSugarRepository userRepository, ISqlSugarRepository agreeRepository)
+ private ILocalEventBus _localEventBus;
+ public AgreeCreatedEventHandler(ISqlSugarRepository userInfoRepository, ISqlSugarRepository agreeRepository, ILocalEventBus localEventBus, ISqlSugarRepository userRepository)
{
- _userRepository = userRepository;
+ _userInfoRepository = userInfoRepository;
_agreeRepository = agreeRepository;
+ _localEventBus = localEventBus;
+ _userRepository = userRepository;
}
public async Task HandleEventAsync(EntityCreatedEventData eventData)
{
var agreeEntity = eventData.Entity;
- var userId = await _agreeRepository._DbQueryable.LeftJoin((agree, discuss) => agree.DiscussId == discuss.Id)
- .Select((agree, discuss) => discuss.CreatorId).FirstAsync();
- //给创建者发布数量+1
- await _userRepository._Db.Updateable()
+ //查询主题的信息
+ var discussAndAgreeDto = await _agreeRepository._DbQueryable
+ .LeftJoin((agree, discuss) => agree.DiscussId == discuss.Id)
+ .Select((agree, discuss) =>
+ new
+ {
+ DiscussTitle = discuss.Title,
+ DiscussCreatorId = discuss.CreatorId,
+ })
+ .FirstAsync();
+
+ //查询点赞者用户
+ var agreeUser = await _userRepository.GetFirstAsync(x => x.Id == agreeEntity.CreatorId);
+
+ //给创建者点赞数量+1
+ await _userInfoRepository._Db.Updateable()
.SetColumns(it => it.AgreeNumber == it.AgreeNumber + 1)
- .Where(it => it.UserId == userId)
+ .Where(it => it.UserId == discussAndAgreeDto.DiscussCreatorId)
.ExecuteCommandAsync();
+
+ //通知主题作者,有人点赞
+ await _localEventBus.PublishAsync(new BbsNoticeEventArgs(discussAndAgreeDto.DiscussCreatorId!.Value, string.Format(DiscussConst.AgreeNotice, discussAndAgreeDto.DiscussTitle, agreeUser.UserName)), false);
+
}
}
-
///
/// 取消点赞
///
- public class AgreeDeletedEventHandler : ILocalEventHandler>,
+ public class AgreeDeletedEventHandler : ILocalEventHandler>,
ITransientDependency
{
private ISqlSugarRepository _userRepository;
private ISqlSugarRepository _agreeRepository;
- public AgreeDeletedEventHandler(ISqlSugarRepository userRepository, ISqlSugarRepository agreeRepository)
+ private ILocalEventBus _localEventBus;
+ public AgreeDeletedEventHandler(ISqlSugarRepository userRepository, ISqlSugarRepository agreeRepository, ILocalEventBus localEventBus)
{
_userRepository = userRepository;
_agreeRepository = agreeRepository;
+ _localEventBus = localEventBus;
}
- public async Task HandleEventAsync(EntityCreatedEventData eventData)
+ public async Task HandleEventAsync(EntityDeletedEventData eventData)
{
var agreeEntity = eventData.Entity;
var userId = await _agreeRepository._DbQueryable.LeftJoin((agree, discuss) => agree.DiscussId == discuss.Id)
.Select((agree, discuss) => discuss.CreatorId).FirstAsync();
- //给创建者发布数量-1
+ //给创建者点赞数量-1
await _userRepository._Db.Updateable()
- .SetColumns(it => it.DiscussNumber == it.DiscussNumber - 1)
+ .SetColumns(it => it.AgreeNumber == it.AgreeNumber - 1)
.Where(it => it.UserId == userId)
.ExecuteCommandAsync();
}
diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/EventHandlers/BbsNoticeCreatedEventHandler.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/EventHandlers/BbsNoticeCreatedEventHandler.cs
deleted file mode 100644
index a8ce92e5..00000000
--- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/EventHandlers/BbsNoticeCreatedEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using Volo.Abp.DependencyInjection;
-using Volo.Abp.Domain.Entities.Events;
-using Volo.Abp.EventBus;
-using Yi.Framework.Bbs.Domain.Entities;
-
-namespace Yi.Framework.Bbs.Domain.EventHandlers
-{
- public class BbsNoticeCreatedEventHandler : ILocalEventHandler>,
- ITransientDependency
- {
- public Task HandleEventAsync(EntityCreatedEventData eventData)
- {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/EventHandlers/BbsNoticeSendEventHandler.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/EventHandlers/BbsNoticeSendEventHandler.cs
new file mode 100644
index 00000000..3067ad17
--- /dev/null
+++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/EventHandlers/BbsNoticeSendEventHandler.cs
@@ -0,0 +1,47 @@
+using Microsoft.AspNetCore.SignalR;
+using SqlSugar;
+using Volo.Abp.DependencyInjection;
+using Volo.Abp.EventBus;
+using Yi.Framework.Bbs.Domain.Entities;
+using Yi.Framework.Bbs.Domain.Shared.Enums;
+using Yi.Framework.Bbs.Domain.Shared.Etos;
+using Yi.Framework.Bbs.Domain.SignalRHubs;
+using Yi.Framework.SqlSugarCore.Abstractions;
+
+namespace Yi.Framework.Bbs.Domain.EventHandlers
+{
+ ///
+ /// bbs消息推送处理
+ ///
+ public class BbsNoticeSendEventHandler : ILocalEventHandler,
+ ITransientDependency
+ {
+ private IHubContext _hubContext;
+ private ISqlSugarRepository _repository;
+ public BbsNoticeSendEventHandler(IHubContext hubContext, ISqlSugarRepository sugarRepository)
+ {
+ _hubContext = hubContext;
+ _repository = sugarRepository;
+ }
+ public async Task HandleEventAsync(BbsNoticeEventArgs eventData)
+ {
+ //离线存储
+ await _repository.InsertAsync(new BbsNoticeAggregateRoot(eventData.NoticeType, eventData.Message, eventData.AcceptUserId));
+ switch (eventData.NoticeType)
+ {
+ case Shared.Enums.NoticeTypeEnum.Personal:
+ if (BbsNoticeHub.HubUserModels.TryGetValue(eventData.AcceptUserId.ToString(), out var hubUserModel))
+ {
+ _hubContext.Clients.Client(hubUserModel.ConnnectionId).SendAsync(NoticeTypeEnum.Personal.ToString(), eventData.Message);
+ }
+ break;
+ case Shared.Enums.NoticeTypeEnum.Broadcast:
+ _hubContext.Clients.All.SendAsync(NoticeTypeEnum.Broadcast.ToString(), eventData.Message);
+ break;
+ default:
+ break;
+ }
+
+ }
+ }
+}
diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/EventHandlers/CommentCreatedEventHandler.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/EventHandlers/CommentCreatedEventHandler.cs
index ebcdaba0..45a5dfcc 100644
--- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/EventHandlers/CommentCreatedEventHandler.cs
+++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/EventHandlers/CommentCreatedEventHandler.cs
@@ -1,8 +1,13 @@
-using Volo.Abp.DependencyInjection;
+using TencentCloud.Tbm.V20180129.Models;
+using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events;
using Volo.Abp.EventBus;
+using Volo.Abp.EventBus.Local;
using Yi.Framework.Bbs.Domain.Entities;
using Yi.Framework.Bbs.Domain.Entities.Forum;
+using Yi.Framework.Bbs.Domain.Shared.Consts;
+using Yi.Framework.Bbs.Domain.Shared.Etos;
+using Yi.Framework.Rbac.Domain.Entities;
using Yi.Framework.SqlSugarCore.Abstractions;
namespace Yi.Framework.Bbs.Domain.EventHandlers
@@ -13,10 +18,14 @@ namespace Yi.Framework.Bbs.Domain.EventHandlers
public class CommentCreatedEventHandler : ILocalEventHandler>,
ITransientDependency
{
- private ISqlSugarRepository _userRepository;
- public CommentCreatedEventHandler(ISqlSugarRepository userRepository)
+ private ILocalEventBus _localEventBus;
+ private ISqlSugarRepository _discussRepository;
+ private ISqlSugarRepository _userRepository;
+ public CommentCreatedEventHandler(ILocalEventBus localEventBus, ISqlSugarRepository discussRepository, ISqlSugarRepository userRepository)
{
_userRepository = userRepository;
+ _localEventBus = localEventBus;
+ _discussRepository = discussRepository;
}
public async Task HandleEventAsync(EntityCreatedEventData eventData)
{
@@ -27,6 +36,24 @@ namespace Yi.Framework.Bbs.Domain.EventHandlers
.SetColumns(it => it.CommentNumber == it.CommentNumber + 1)
.Where(it => it.UserId == commentEntity.CreatorId)
.ExecuteCommandAsync();
+ var disucssDto = await _discussRepository._DbQueryable
+ .Where(x => x.Id == commentEntity.DiscussId)
+ .LeftJoin((dicuss, user) => dicuss.CreatorId == user.Id)
+ .Select((dicuss, user) =>
+ new
+ {
+ DiscussId = user.Id,
+ DiscussTitle = dicuss.Title,
+
+ })
+ .FirstAsync();
+
+ var commentUser = await _userRepository.GetFirstAsync(x => x.Id == commentEntity.CreatorId);
+
+ //截取10个长度
+ var content = commentEntity.Content.Length >= 10 ? commentEntity.Content.Substring(0, 10) : commentEntity.Content;
+ //通知主题作者,有人评论
+ await _localEventBus.PublishAsync(new BbsNoticeEventArgs(disucssDto.DiscussId, string.Format(DiscussConst.CommentNotice, disucssDto.DiscussTitle, commentUser.UserName, content)), false);
}
}
}
diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/SignalRHubs/BbsNoticeHub.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/SignalRHubs/BbsNoticeHub.cs
new file mode 100644
index 00000000..57d78288
--- /dev/null
+++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/SignalRHubs/BbsNoticeHub.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Authorization;
+using Volo.Abp.AspNetCore.SignalR;
+using Yi.Framework.Bbs.Domain.Shared.Model;
+
+namespace Yi.Framework.Bbs.Domain.SignalRHubs
+{
+ [HubRoute("/hub/bbs-notice")]
+ [Authorize]
+ public class BbsNoticeHub : AbpHub
+ {
+ ///
+ /// hub连接与用户id的映射关系存储
+ ///
+ public static ConcurrentDictionary HubUserModels = new ConcurrentDictionary();
+
+ ///
+ /// 连接添加用户信息
+ ///
+ ///
+ public override Task OnConnectedAsync()
+ {
+ var hubUser = new HubUserModel(Context.ConnectionId, CurrentUser.Id!.Value);
+ HubUserModels.TryAdd(CurrentUser.Id.Value.ToString(), hubUser);
+ return Task.CompletedTask;
+ }
+
+ ///
+ /// 断开连接,去除用户连接信息
+ ///
+ ///
+ ///
+ public override Task OnDisconnectedAsync(Exception exception)
+ {
+ HubUserModels.TryRemove(CurrentUser.Id.Value.ToString(), out _);
+ return Task.CompletedTask;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Yi.Bbs.Vue3/package-lock.json b/Yi.Bbs.Vue3/package-lock.json
index 27b62785..a541773c 100644
--- a/Yi.Bbs.Vue3/package-lock.json
+++ b/Yi.Bbs.Vue3/package-lock.json
@@ -12,7 +12,7 @@
"@lucky-canvas/vue": "^0.1.11",
"@microsoft/signalr": "^8.0.0",
"axios": "^1.3.4",
- "dayjs": "^1.11.10",
+ "dayjs": "^1.11.11",
"echarts": "^5.4.2",
"element-plus": "^2.2.32",
"highlight": "^0.2.4",
@@ -1894,9 +1894,9 @@
"integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w=="
},
"node_modules/dayjs": {
- "version": "1.11.10",
- "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.10.tgz",
- "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ=="
+ "version": "1.11.11",
+ "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.11.tgz",
+ "integrity": "sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg=="
},
"node_modules/debug": {
"version": "4.3.4",
@@ -5551,9 +5551,9 @@
"integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w=="
},
"dayjs": {
- "version": "1.11.10",
- "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.10.tgz",
- "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ=="
+ "version": "1.11.11",
+ "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.11.tgz",
+ "integrity": "sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg=="
},
"debug": {
"version": "4.3.4",
diff --git a/Yi.Bbs.Vue3/package.json b/Yi.Bbs.Vue3/package.json
index 26724971..9c082b5b 100644
--- a/Yi.Bbs.Vue3/package.json
+++ b/Yi.Bbs.Vue3/package.json
@@ -13,7 +13,7 @@
"@lucky-canvas/vue": "^0.1.11",
"@microsoft/signalr": "^8.0.0",
"axios": "^1.3.4",
- "dayjs": "^1.11.10",
+ "dayjs": "^1.11.11",
"echarts": "^5.4.2",
"element-plus": "^2.2.32",
"highlight": "^0.2.4",
diff --git a/Yi.Bbs.Vue3/src/App.vue b/Yi.Bbs.Vue3/src/App.vue
index 36c227f9..a5e1d28e 100644
--- a/Yi.Bbs.Vue3/src/App.vue
+++ b/Yi.Bbs.Vue3/src/App.vue
@@ -8,6 +8,7 @@
+
diff --git a/Yi.Bbs.Vue3/src/stores/notice.js b/Yi.Bbs.Vue3/src/stores/notice.js
new file mode 100644
index 00000000..90e6c708
--- /dev/null
+++ b/Yi.Bbs.Vue3/src/stores/notice.js
@@ -0,0 +1,33 @@
+import { defineStore } from "pinia";
+const chatStore = defineStore("notice", {
+ state: () => ({
+ noticeList: []
+ }),
+ getters: {
+ noticeForNoReadCount:(state)=>{
+ return state.noticeList.filter(x => x.isRead ==false).length;
+ }
+
+ },
+ actions:
+ {
+ addNotice(msg) {
+ this.noticeList.unshift(msg);
+ },
+ addNotices(msgs) {
+
+ msgs.forEach(item => {
+ this.addNotice(item);
+ });
+ },
+ setNotices(msgs) {
+ this.noticeList=msgs;
+ },
+ removeNotice(id)
+ {
+ this.noticeList = this.noticeList.filter(obj => obj.id != id);
+ }
+ },
+});
+
+export default chatStore;
diff --git a/Yi.Bbs.Vue3/yarn.lock b/Yi.Bbs.Vue3/yarn.lock
index 15f1d6e7..ad77187d 100644
--- a/Yi.Bbs.Vue3/yarn.lock
+++ b/Yi.Bbs.Vue3/yarn.lock
@@ -955,10 +955,10 @@ csstype@^2.6.8:
resolved "https://registry.npmmirror.com/csstype/-/csstype-2.6.21.tgz"
integrity sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==
-dayjs@^1.11.10, dayjs@^1.11.3:
- version "1.11.10"
- resolved "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.10.tgz"
- integrity sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==
+dayjs@^1.11.11, dayjs@^1.11.3:
+ version "1.11.11"
+ resolved "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.11.tgz"
+ integrity sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==
debug@^4.1.0, debug@^4.3.1, debug@^4.3.4, debug@4:
version "4.3.4"