当我将Iron Router升级到blaze集成分支时,我开始收到此警告:
"You called this.stop() inside a hook or your action function but you should use pause() now instead"
Run Code Online (Sandbox Code Playgroud)
Chrome控制台 - > iron-router.js:2104 - > client/route_controller.js:193 from package
代码在客户端:
Router.before(mustBeSignedIn, {except: ['userSignin', 'userSignup', 'home']});
var mustBeSignedIn = function () {
if (!Meteor.user()) {
// render the home template
this.redirect('home');
// stop the rest of the before hooks and the action function
this.stop();
return false;
}
return true;
}
Run Code Online (Sandbox Code Playgroud)
我试着更换this.stop()同:pause(),Router.pause()和this.pause(),但仍然无法正常工作.另外我还没有在铁路由器包上找到暂停功能.
如何正确更换this.stop()用 …