diff --git a/resource/static/main.js b/resource/static/main.js index 30f3195..2c9a446 100644 --- a/resource/static/main.js +++ b/resource/static/main.js @@ -48,7 +48,13 @@ function showFormModal(modelSelector, formID, URL, getData) { $.post(URL, JSON.stringify(data)).done(function (resp) { if (resp.code == 200) { if (resp.message) { - alert(resp.message) + $.suiAlert({ + title: '操作成功', + type: 'success', + description: resp.message, + time: '3', + position: 'top-center', + }); } window.location.reload() } else { @@ -74,6 +80,7 @@ function logout(id) { $.suiAlert({ title: '注销成功', type: 'success', + description: '如需继续访问请使用 GitHub 再次登录', time: '3', position: 'top-center', }); @@ -88,6 +95,12 @@ function logout(id) { }); } }).fail(function (err) { - alert('网络错误:' + err.responseText) + $.suiAlert({ + title: '网络错误', + description: err.responseText, + type: 'error', + time: '3', + position: 'top-center', + }); }) } diff --git a/resource/template/page/home.html b/resource/template/page/home.html index 07c35ee..ae68a05 100644 --- a/resource/template/page/home.html +++ b/resource/template/page/home.html @@ -99,7 +99,7 @@ methods: { secondToDate(s) { var d = Math.floor(s / 3600 / 24); - var h = Math.floor(s / 3600); + var h = Math.floor(s / 3600 % 24); var m = Math.floor((s / 60 % 60)); var s = Math.floor((s % 60)); return result = d + "天" + h + "小时" + m + "分钟" + s + "秒";