瀏覽代碼

修改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)