Merge branch 'weixin_guange' of https://git.trustie.net/jacknudt/trustieforge into weixin_guange

This commit is contained in:
txz 2016-04-05 16:32:38 +08:00
commit 50c6b565e7
2 changed files with 7 additions and 7 deletions

View File

@ -2,7 +2,7 @@ button:
-
type: "view"
name: "最新动态"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=http://wechat.trustie.net/assets/wechat/app.html&response_type=code&scope=snsapi_base&state=123#wechat_redirect"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=http://wechat.trustie.net/assets/wechat/app.html#/activities?response_type=code&scope=snsapi_base&state=123#wechat_redirect"
-
type: "click"
name: "意见返馈"

View File

@ -4,7 +4,7 @@ var apiUrl = 'http://wechat.trustie.net/api/v1/';
var openid = '';
var debug = false; //调试标志,如果在本地请置为true
if(debug){
if(debug===true){
openid = "oCnvgvz8R7QheXE-R9Kkr39j8Ndg";
}
@ -22,7 +22,8 @@ app.factory('auth', function($http,$routeParams){
data: {code: code},
method: 'POST'
}).then(function successCallback(response) {
_openid = data.openid;
_openid = response.data.openid;
openid = _openid;
cb(_openid);
}, function errorCallback(response) {
cb(null);
@ -57,11 +58,10 @@ app.controller('ActivityController',function($scope, $http, auth){
});
}
auth.getOpenId(function(openid){
if(!openid){
auth.getOpenId(function(oid){
if(!oid){
alert("获取openid出错");
} else {
openid = openid;
loadActData($scope.page);
}
});
@ -136,4 +136,4 @@ app.config(['$routeProvider',function ($routeProvider) {
.otherwise({
redirectTo: '/activities'
});
}]);
}]);