소스 검색

修改bug

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

+ 3 - 1
api/login.php

@@ -8,11 +8,13 @@
 try {
 
     $weixin_public = new weixin_public(APPID, APPSECRET, APPURI);
-    $weixin_public->redirectWithCode();
+    $redirectUrl = $weixin_public->redirectWithCode();
+    echo action_msg($redirectUrl, 200);
     exit;
 
 } catch (MyException $e) {
     echo action_msg($e->getMessage(), $e->getCode());
+    exit;
 }
 
 ?>

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

@@ -39,8 +39,9 @@ class weixin_public
             ."&redirect_uri=".$this->uri
             ."&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
 
-        header('Location: '.$url);
-        exit;
+        //header('Location: '.$url);
+
+        return $url;
     }
 
     private function getAcessTokenAndOpenId($code)