From 61dc9f8166e93b0cdf078dee06efd74426520c8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=87=95=E9=B9=8F?= Date: Sun, 27 Sep 2020 18:17:43 +0800 Subject: [PATCH] 404 --- client/templates/not_found.html | 3 +++ lib/router.js | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 client/templates/not_found.html diff --git a/client/templates/not_found.html b/client/templates/not_found.html new file mode 100644 index 0000000..2d8bef4 --- /dev/null +++ b/client/templates/not_found.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/lib/router.js b/lib/router.js index 44f8eca..53b2ecd 100644 --- a/lib/router.js +++ b/lib/router.js @@ -1,9 +1,11 @@ import "/client/templates/loading.html" import "/client/templates/userPage.html" +import "/client/templates/not_found.html" Router.configure({ layoutTemplate: 'mainLayout', loadingTemplate: 'loading', + notFoundTemplate: 'notFound', waitOn: function () { return Meteor.subscribe("url_res") } @@ -22,3 +24,5 @@ Router.route("/user/:_id", { } }) +Router.onBeforeAction('dataNotFound',{only: 'userPage'}) +