소스 검색

修改bug

chenbo 4 년 전
부모
커밋
66bb20d4f3
2개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      api/wxinfo.php
  2. 1 2
      lib/common/weixin_public.class.php

+ 1 - 1
api/wxinfo.php

@@ -11,7 +11,7 @@ try {
     $info = $weixin_public->getAllInfo($code);
 
     if (empty($info['openid'])) {
-        echo action_msg($info['errmsg'], 1);
+        echo action_msg($info['errmsg'], $info['errcode']);
         exit;
     } else {
         $attr = Reader::getInfoByOpenId($info['openid']);

+ 1 - 2
lib/common/weixin_public.class.php

@@ -57,9 +57,8 @@ class weixin_public
     {
         $info = self::getAcessTokenAndOpenId($code);
 
-        $ret = array();
         if (empty($info['access_token']) || empty($info['openid'])) {
-            return $ret;
+            return $info;
         }
 
         $url = "https://api.weixin.qq.com/sns/userinfo?access_token=".$info['access_token']."&openid=".$info['openid']."&lang=zh_CN";