详情页出错

This commit is contained in:
guange 2016-04-05 17:35:27 +08:00
parent 23ec67b2eb
commit 606599047d
1 changed files with 10 additions and 8 deletions
public/javascripts/wechat

View File

@ -21,20 +21,22 @@ app.factory('auth', function($http,$routeParams, $cookies){
method: 'POST'
}).then(function successCallback(response) {
_openid = response.data.openid;
if(debug !== true){ //如果是生产环境,就存到cookies中
$cookies.put("openid", _openid);
if(typeof _openid !== 'undefined' && _openid.length>0){
if(debug !== true){ //如果是生产环境,就存到cookies中
$cookies.put("openid", _openid);
}
} else {
if(debug!==true){//考虑从cookies中取出
_openid = $cookies.get('openid');
}
}
cb(_openid);
}, function errorCallback(response) {
if(debug!==true){//考虑从cookies中取出
_openid = $cookies.get('openid');
}
cb(_openid);
cb(null);
});
};
var openid = function(){
return _openid;
}