From 3c7e98505b6366ae6819bf6fe7c9c402b7e06b0e Mon Sep 17 00:00:00 2001
From: wolegca <2738076308@qq.com>
Date: Mon, 30 Sep 2019 16:44:06 +0800
Subject: [PATCH] add 404
---
404.html | 46 ++++++++++++++++++++++++++++++++++++++++++++++
js/404.js | 3 +++
js/initialize.js | 12 +++++++++---
3 files changed, 58 insertions(+), 3 deletions(-)
create mode 100644 404.html
create mode 100644 js/404.js
diff --git a/404.html b/404.html
new file mode 100644
index 0000000..44b61e6
--- /dev/null
+++ b/404.html
@@ -0,0 +1,46 @@
+---
+permalink:/404.html
+---
+
+
+
+
+
+
+
+
+
+ LAOZHONGYI BLOG
+
+
+
+
+
AHPU 老中医的博客
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/js/404.js b/js/404.js
new file mode 100644
index 0000000..d0f64be
--- /dev/null
+++ b/js/404.js
@@ -0,0 +1,3 @@
+message.alert('404 Not Found', '您所查找的页面不存在',function(){
+ window.location.href = '/';
+});
\ No newline at end of file
diff --git a/js/initialize.js b/js/initialize.js
index dce6468..5266706 100644
--- a/js/initialize.js
+++ b/js/initialize.js
@@ -29,10 +29,13 @@ $(function () {
m.remove();
}, 300);
message.alertCode = '';
+ if(message.callback)
+ message.callback();
});
})();
var message = new function () {
+ this.callback = undefined;
this.alertCode = '';
this.alert = function () {
@@ -43,7 +46,8 @@ var message = new function () {
}
var arg1 = arguments[0],
- arg2 = arguments[1];
+ arg2 = arguments[1],
+ callback = arguments[2];
if (arguments.length <= 1) {
header = '提示';
@@ -53,11 +57,13 @@ var message = new function () {
content = (arg2 === undefined ? '提示内容' : arg2);
}
- message.appendHtml(header, content);
+ message.callback = callback;
+ appendHtml(header, content);
+
}
- this.appendHtml = function (header, content) {
+ function appendHtml (header, content) {
var id = uuid();
var html =
'' +