account-ui
使用Meteor.logout(function(err){
console.log(err);
}
(或从控制台调用事件
FlowRouter.route('/sign-out', {
name: 'signOut',
action() {
if(Meteor.userId()){
Meteor.logout((err) => {
console.log(err);
FlowRouter.go('/');
});
}
}
});
在两种情况下都不会调用回调
我尝试从事件,服务器端和客户端调用它,结果相同。仍然加载,什么都不做。
如果我创建一个仅用于注销目的的路由,如下所示
meteor-base@1.0.4
mobile-experience@1.0.4
mongo@1.1.17
blaze-html-templates@1.0.4
reactive-var@1.0.11
tracker
standard-minifier-css@1.3.4
standard-minifier-js@2.0.0
es5-shim@4.6.15
ecmascript@0.7.3
shell-server@0.2.3
jquery
mizzao:jquery-ui
kadira:flow-router
kadira:blaze-layout
dburles:collection-helpers
aldeed:collection2
raix:handlebar-helpers
fastclick#@1.0.13
spiderable
stolinski:stylus-multi
kadira:dochead
accounts-ui#@1.1.9
accounts-password#@1.3.6
zimme:active-route
gwendall:auth-client-callbacks
meteortoys:allthings
check
tap:i18n
email
momentjs:moment
ejson
dburles:google-maps
lukemadera:autoform-googleplace
comerc:bs-typeahead
aldeed:autoform
aldeed:delete-button
comerc:autoform-typeahead
gildaspk:autoform-materialize
udondan:googlefonts
planettraining:material-design-icons-font
materialize:materialize #http://materializecss.com
matb33:bootstrap-glyphicons
fortawesome:fontawesome
dapearce:material-icons
yogiben:autoform-file
cfs:standard-packages
cfs:s3
cfs:graphicsmagick
不会注销,但如果我刷新页面,注销就会生效。
那是我的包裹清单
Meteor.logout()
这很奇怪,但这就是我的情况。如何解决"click .logout" (event){
console.log("logout1");
event.preventDefault();
console.log("logout2");
Meteor.logout();
console.log("logout3");
FlowRouter.go('/');
console.log("logout4");
}
工作?
Template.Guest_header.onRendered(function(){
var instance = this;
console.log("start1 "+Meteor.userId());
instance.autorun(function(){
console.log("start2 "+Meteor.userId());
instance.subscribe("me");
console.log("start3 "+Meteor.userId());
instance.$(".button-collapse").sideNav();
console.log("start4 "+Meteor.userId());
});
});
button
点击.sign-out
上课 "click .logout" (event){
console.log("logout1 "+Meteor.userId());
event.preventDefault();
console.log("logout2 "+Meteor.userId());
Meteor.logout();
console.log("logout3 "+Meteor.userId());
FlowRouter.go('/');
console.log("logout4 "+Meteor.userId());
}
class="lang"