From 505db126f5328f445e8ef642ebfb08d2c0c7df59 Mon Sep 17 00:00:00 2001 From: young40 Date: Sat, 19 May 2012 21:29:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8F=91=E8=A1=A8=E8=AF=9D?= =?UTF-8?q?=E9=A2=98=E6=88=96=E5=9B=9E=E5=A4=8D=E6=97=B6,=20=E5=90=8C?= =?UTF-8?q?=E6=97=B6=E6=9B=B4=E6=96=B0session=E4=B8=AD=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=9A=84=E7=A7=AF=E5=88=86=E5=80=BC.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/reply.js | 3 ++- controllers/topic.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/controllers/reply.js b/controllers/reply.js index e11b6a4..574352e 100644 --- a/controllers/reply.js +++ b/controllers/reply.js @@ -67,7 +67,8 @@ exports.add = function(req,res,next){ if(err) return next(err); user.score += 5; user.reply_count += 1; - user.save() + user.save(); + req.session.user.score += 5; proxy.trigger('score_saved'); }); }; diff --git a/controllers/topic.js b/controllers/topic.js index c9f6ceb..1f62666 100644 --- a/controllers/topic.js +++ b/controllers/topic.js @@ -214,7 +214,8 @@ exports.create = function(req,res,next){ if(err) return next(err); user.score += 5; user.topic_count += 1; - user.save() + user.save(); + req.session.user.score += 5; proxy.trigger('score_saved'); });