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

1

parent fed49d6b
...@@ -17,17 +17,13 @@ exports.createUser=function(entity,callback){ ...@@ -17,17 +17,13 @@ exports.createUser=function(entity,callback){
//根据Uid获取用户 //根据Uid获取用户
exports.getUserByUid=function(uid,callback){ exports.getUserByUid=function(uid,callback){
console.log('==============uid:'+uid);
ForumUser.findOne({uid:uid}).exec(function(err,result){ ForumUser.findOne({uid:uid}).exec(function(err,result){
if(err){ if(err){
callback(err,null); callback(err,null);
}else{ }else{
console.log('==============result:'+result);
if(result ){ if(result ){
console.log('=================in a');
callback(null,result); callback(null,result);
}else{ }else{
console.log('=================in b');
callback(null,null); callback(null,null);
} }
} }
......
...@@ -21,6 +21,7 @@ exports.getOpenId=function(req){ ...@@ -21,6 +21,7 @@ exports.getOpenId=function(req){
exports.identifyUser=function() { exports.identifyUser=function() {
return function(req, res,next){ return function(req, res,next){
if(!req.session.mobileForumUser){
forumUserService.getUserByUid(req.session.openUser.openId,function(err,doc){ forumUserService.getUserByUid(req.session.openUser.openId,function(err,doc){
if(err){ if(err){
next(err); next(err);
...@@ -32,6 +33,10 @@ exports.identifyUser=function() { ...@@ -32,6 +33,10 @@ exports.identifyUser=function() {
}; };
next(null); next(null);
}else{ }else{
if(req.session.tmpOpenId){
next(null);
}else{
req.session.tmpOpenId=req.session.openUser.openId;
var entity={ var entity={
uid:req.session.openUser.openId, uid:req.session.openUser.openId,
nickName:req.session.openUser.nickName, nickName:req.session.openUser.nickName,
...@@ -51,7 +56,12 @@ exports.identifyUser=function() { ...@@ -51,7 +56,12 @@ exports.identifyUser=function() {
}); });
} }
} }
}
}); });
}else{
next(null);
}
} }
} }
\ No newline at end of file
...@@ -23,8 +23,7 @@ var config = { ...@@ -23,8 +23,7 @@ var config = {
bucketNameDev:'pisns-oss-dev', bucketNameDev:'pisns-oss-dev',
prodCDNURL:'http://fs.wxpai.cn/', prodCDNURL:'http://fs.wxpai.cn/',
devCDNURL:'http://dev.fs.wxpai.cn/' devCDNURL:'http://dev.fs.wxpai.cn/'
}, }
indexUrl:'http://www.baidu.com'
}, },
test: { test: {
...@@ -46,8 +45,7 @@ var config = { ...@@ -46,8 +45,7 @@ var config = {
bucketNameDev:'pisns-oss-dev', bucketNameDev:'pisns-oss-dev',
prodCDNURL:'http://fs.wxpai.cn/', prodCDNURL:'http://fs.wxpai.cn/',
devCDNURL:'http://dev.fs.wxpai.cn/' devCDNURL:'http://dev.fs.wxpai.cn/'
}, }
indexUrl:''
}, },
...@@ -71,8 +69,7 @@ var config = { ...@@ -71,8 +69,7 @@ var config = {
bucketNameDev:'pisns-oss-dev', bucketNameDev:'pisns-oss-dev',
prodCDNURL:'http://fs.wxpai.cn/', prodCDNURL:'http://fs.wxpai.cn/',
devCDNURL:'http://dev.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