燕鹏 4 years ago
parent
commit
61dc9f8166
  1. 3
      client/templates/not_found.html
  2. 4
      lib/router.js

3
client/templates/not_found.html

@ -0,0 +1,3 @@
<template name="notFound">
404
</template>

4
lib/router.js

@ -1,9 +1,11 @@
import "/client/templates/loading.html" import "/client/templates/loading.html"
import "/client/templates/userPage.html" import "/client/templates/userPage.html"
import "/client/templates/not_found.html"
Router.configure({ Router.configure({
layoutTemplate: 'mainLayout', layoutTemplate: 'mainLayout',
loadingTemplate: 'loading', loadingTemplate: 'loading',
notFoundTemplate: 'notFound',
waitOn: function () { waitOn: function () {
return Meteor.subscribe("url_res") return Meteor.subscribe("url_res")
} }
@ -22,3 +24,5 @@ Router.route("/user/:_id", {
} }
}) })
Router.onBeforeAction('dataNotFound',{only: 'userPage'})

Loading…
Cancel
Save