ユーザーデータ全体ではなく、サーバー端末に[object、Object]が表示されています。私はそれが何を意味するのか分かりません...私はすべてを完全に行いましたが、それでもデータ全体を得ることはできません。私はsailjsサーバーを指定しました。 [object、Object]ではなく、全体のユーザーデータを取得する方法は?全体のユーザーデータの代わりに[オブジェクト、オブジェクト]を取得しています。どういう意味ですか?
module.exports = {
/**
* Check the provided email address and password, and if they
* match a real user in the database, sign in to Medool.
*/
login: function (req, res) {
// Try to look up user using the provided email address
User.findOne({
email: req.param('email')
}, function foundUser(err, user) {
if (err)
return res.negotiate(err);
if (!user)
return res.notFound();
// Compare password attempt from the form params to the encrypted password
// from the database (`user.password`)
require('machinepack-passwords').checkPassword({
passwordAttempt: req.param('password'),
encryptedPassword: user.encryptedPassword
}).exec({
error: function (err) {
return res.negotiate(err);
},
/*
If the password from the form params doesn't checkout w/ the encrypted
password from the database...
*/
incorrect: function() {
return res.notFound();
},
success: function() {
// Store user id in the user session
console.log("User form the login check" +user)
req.session.me = user.helpsterId;
console.log(req.session.me);
// All done- let the client know that everything worked.
return res.ok();
}
});
});
}
};
Output when lifted server is [object, Object]in console
http://stackoverflow.com/questions/10729276/how-can-i-get-the-full-object-in-node-js-console-log-rather-than-object – cl3m
こちらをご覧ください文字列とオブジェクトを連結するときには、 'console.log("ユーザーはログインチェックの形でユーザ ")を実行してください。 – adeneo
javascriptオブジェクトの' toString'が '' [object Object]」と評価されます' – Akshay