通知公告增加右上角弹窗提醒,及浏览器通知
This commit is contained in:
parent
1d179c2105
commit
3c24343c5a
@ -3,13 +3,13 @@ ENV = 'production'
|
||||
|
||||
|
||||
# 生产环境
|
||||
VITE_APP_BASE_API = '/zradminvue-api'
|
||||
VITE_APP_BASE_API = '/prod-api'
|
||||
|
||||
# 路由前缀
|
||||
VITE_APP_ROUTER_PREFIX = '/zradminvue'
|
||||
VITE_APP_ROUTER_PREFIX = '/'
|
||||
|
||||
# 默认上传地址
|
||||
VITE_APP_UPLOAD_URL = '/Common/UploadFile'
|
||||
|
||||
#socket API
|
||||
VITE_APP_SOCKET_API = '/zradminvuemsghub'
|
||||
VITE_APP_SOCKET_API = '/msghub'
|
||||
|
||||
@ -26,6 +26,17 @@ export default {
|
||||
if (data.code == 200) {
|
||||
useSocketStore().setUnreadNoticeList(data.data.unReadNotifications)
|
||||
useSocketStore().setReadNoticeList(data.data.readNotifications)
|
||||
data.data.unReadNotifications.forEach((ele) => {
|
||||
const title = `来自${ele.create_name}的通知公告`
|
||||
ElNotification({
|
||||
title: title,
|
||||
message: ele.noticeContent,
|
||||
type: 'success',
|
||||
duration: 0,
|
||||
dangerouslyUseHTMLString: true
|
||||
})
|
||||
})
|
||||
webNotify({ title: import.meta.env.VITE_APP_TITLE, body: `你有${data.data.unReadNotifications.length}条通知公告待查看` })
|
||||
}
|
||||
})
|
||||
// 接受聊天数据
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user