Commit 059b8dbc authored by 张淼's avatar 张淼

1

parent fed49d6b
......@@ -17,17 +17,13 @@ exports.createUser=function(entity,callback){
//根据Uid获取用户
exports.getUserByUid=function(uid,callback){
console.log('==============uid:'+uid);
ForumUser.findOne({uid:uid}).exec(function(err,result){
if(err){
callback(err,null);
}else{
console.log('==============result:'+result);
if(result ){
console.log('=================in a');
callback(null,result);
}else{
console.log('=================in b');
callback(null,null);
}
}
......
......@@ -21,6 +21,7 @@ exports.getOpenId=function(req){
exports.identifyUser=function() {
return function(req, res,next){
if(!req.session.mobileForumUser){
forumUserService.getUserByUid(req.session.openUser.openId,function(err,doc){
if(err){
next(err);
......@@ -32,6 +33,10 @@ exports.identifyUser=function() {
};
next(null);
}else{
if(req.session.tmpOpenId){
next(null);
}else{
req.session.tmpOpenId=req.session.openUser.openId;
var entity={
uid:req.session.openUser.openId,
nickName:req.session.openUser.nickName,
......@@ -51,7 +56,12 @@ exports.identifyUser=function() {
});
}
}
}
});
}else{
next(null);
}
}
}
\ No newline at end of file
......@@ -23,8 +23,7 @@ var config = {
bucketNameDev:'pisns-oss-dev',
prodCDNURL:'http://fs.wxpai.cn/',
devCDNURL:'http://dev.fs.wxpai.cn/'
},
indexUrl:'http://www.baidu.com'
}
},
test: {
......@@ -46,8 +45,7 @@ var config = {
bucketNameDev:'pisns-oss-dev',
prodCDNURL:'http://fs.wxpai.cn/',
devCDNURL:'http://dev.fs.wxpai.cn/'
},
indexUrl:''
}
},
......@@ -71,8 +69,7 @@ var config = {
bucketNameDev:'pisns-oss-dev',
prodCDNURL:'http://fs.wxpai.cn/',
devCDNURL:'http://dev.fs.wxpai.cn/'
},
indexUrl:''
}
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment