diff --git a/static/fail.html b/static/fail.html
new file mode 100644
index 0000000..e32ab7c
--- /dev/null
+++ b/static/fail.html
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+ 投票失败
+
+
+
+
投票发生错误,可能是由于你此前已经投过,或是网络问题。
+
+
+
diff --git a/static/finish.html b/static/finish.html
new file mode 100644
index 0000000..0cfac67
--- /dev/null
+++ b/static/finish.html
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+ 投票完成
+
+
+
+
+
diff --git a/static/js/vote.js b/static/js/vote.js
index 443f2dd..e219c58 100644
--- a/static/js/vote.js
+++ b/static/js/vote.js
@@ -13,6 +13,7 @@ function doVote() {
response.text().then(body => {
if (!response.ok) {
alert(body)
+ location.href="fail.html"
} else {
let magicString = findMagic(body)
fetch("/submit", {
@@ -24,6 +25,9 @@ function doVote() {
}).then(res => {
if (!res.ok) {
res.text().then(res => alert(res))
+ location.href="fail.html"
+ } else {
+ location.href="finish.html"
}
})
}