mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-11-10 04:50:50 +08:00
fix(notice): 修复铃铛轮询时机/个人消息接口地址/订阅保存地址与详情接收时间
This commit is contained in:
@@ -117,7 +117,9 @@ class NoticeBase extends AdminController
|
|||||||
'scene_title' => $sceneTitleMap[(string) ($notice->scene ?? '')] ?? (string) ($notice->scene ?? '-'),
|
'scene_title' => $sceneTitleMap[(string) ($notice->scene ?? '')] ?? (string) ($notice->scene ?? '-'),
|
||||||
'content' => (string) ($notice->content ?? ''),
|
'content' => (string) ($notice->content ?? ''),
|
||||||
'read_time' => (int) $row->read_time,
|
'read_time' => (int) $row->read_time,
|
||||||
'create_time' => (int) $row->create_time,
|
// create_time 是自动时间戳字段,模型属性读取会格式化为日期字符串,
|
||||||
|
// 再 (int) 强转只会取到前导年份(详情页显示 1970),必须取原始数据
|
||||||
|
'create_time' => (int) $row->getData('create_time'),
|
||||||
];
|
];
|
||||||
$this->assign('msg', $msg);
|
$this->assign('msg', $msg);
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ function initUnreadPolling() {
|
|||||||
setInterval(fetchUnreadCount, pollInterval);
|
setInterval(fetchUnreadCount, pollInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window.pageType === 'index') {
|
// content_js 注入时机早于顶栏 DOM 就绪,必须等 DOM ready 再捕获 #ua-notice-unread,
|
||||||
initUnreadPolling();
|
// 否则闭包固化空 jQuery 集合,text/show 静默 no-op,badge 永不显示
|
||||||
}
|
$(function () {
|
||||||
|
if (window.pageType === 'index') {
|
||||||
|
initUnreadPolling();
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -40,7 +40,7 @@ $(function(){
|
|||||||
[{
|
[{
|
||||||
text: '标记已读',
|
text: '标记已读',
|
||||||
title: '确定将勾选的消息标记为已读?',
|
title: '确定将勾选的消息标记为已读?',
|
||||||
url: 'notice/mark_read',
|
url: 'notice/markRead',
|
||||||
method: 'request',
|
method: 'request',
|
||||||
auth: 'notice/markRead',
|
auth: 'notice/markRead',
|
||||||
class: 'layui-btn layui-btn-normal layui-btn-sm',
|
class: 'layui-btn layui-btn-normal layui-btn-sm',
|
||||||
@@ -50,7 +50,7 @@ $(function(){
|
|||||||
[{
|
[{
|
||||||
text: '全部已读',
|
text: '全部已读',
|
||||||
title: '确定将全部站内信标记为已读?',
|
title: '确定将全部站内信标记为已读?',
|
||||||
url: 'notice/mark_all_read',
|
url: 'notice/markAllRead',
|
||||||
method: 'request',
|
method: 'request',
|
||||||
auth: 'notice/markAllRead',
|
auth: 'notice/markAllRead',
|
||||||
class: 'layui-btn layui-btn-warm layui-btn-sm',
|
class: 'layui-btn layui-btn-warm layui-btn-sm',
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
<div class="hr-line"></div>
|
<div class="hr-line"></div>
|
||||||
<div class="layui-form-item text-center">
|
<div class="layui-form-item text-center">
|
||||||
<button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="notice/save_subscribe" data-close="false" data-refresh="false">保存设置</button>
|
<button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="notice/saveSubscribe" data-close="false" data-refresh="false">保存设置</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user