1
我有以下代碼:燼,簡單-auth的更新數據
changeUsername: function(){
var _this = this;
this.store.findById('user', this.session.get('user.id')).then(function(user){
user.set('username', _this.get('newUsername'));
user.save();
_this.session.set('user.username', _this.get('newUsername'));
_this.session.persist();
});
}
正如你所看到的 - 我堅持到餘燼簡單的權威性會議,我想在這個方法更新用戶對象。
呼叫持續在會話上並沒有辦法。
我也曾嘗試:
_this.session.store.set('user.username', _this.get('newUsername'));
_this.session.store.save();
這也不能工作。
如何更新會話上的用戶對象?