const workordertimer = setInterval(function () { $.ajax({ url: '/'+window.location.pathname.split('/')[1]+'/workorder_notice', type: 'POST', data: {}, dataType: 'text', success: function (res) { if (res == true) { Dcat.info("你有新的工单信息 [前往查看]", '新消息提醒', { closeButton: true, escapeHtml: false, timeOut: 10000, extendedTimeOut: 5000, onHidden: function () { if (window.location.pathname == '/'+window.location.pathname.split('/')[1]+'/workorder_item') { location.reload() } } }) } }, error: function (error) { } }); }, 5000);