Browse Source

Merge branch 'qixi_test' of 121.43.114.153:/home/git/repositories/shopnc into qixi_test

stanley-king 6 years ago
parent
commit
4d8a800d12
3 changed files with 7 additions and 36 deletions
  1. 2 8
      helper/third_author/wxauthor.php
  2. 1 2
      mobile/control/festval.php
  3. 4 26
      mobile/wxauthor.php

+ 2 - 8
helper/third_author/wxauthor.php

@@ -34,20 +34,14 @@ class wxauthor
         $this->mErrcode = 0;
     }
 
-    public function enter($origin_url,$state_param=[])
+    public function enter($origin_url)
     {
         $back_url = 'https://passport.lrlz.com/mobile/wxauthor.php';
-        $state =  urlencode(BASE_SITE_URL);
-        if(!empty($state_param)){
-            $state_param = implode('_',$state_param);
-            $state .= '_'.$state_param;
-        }
         $params = [ 'appid' => self::appid,
                     'redirect_uri' => $back_url,
                     'response_type' => 'code',
                     'scope' => 'snsapi_userinfo',
-                    'state' => $state
-        ];
+                    'state' => urlencode(BASE_SITE_URL)];
         $ref_url = util::http_add_params(self::authorize_url,$params);
         $ref_url .= '#wechat_redirect';
         wechat_helper::set_origin_url($origin_url);

+ 1 - 2
mobile/control/festval.php

@@ -39,10 +39,9 @@ class festvalControl extends mobileControl
     {
         if(session_helper::need_wechat_author())
         {
-            $param = ["festval", "qixi"];$param = [];
             $author = new thrid_author\wxauthor();
             $url = urlencode(BASE_SITE_URL . "/mobile/index.php?act=festval&op=qixi");
-            $url = $author->enter($url,$param);
+            $url = $author->enter($url);
             return self::outsuccess(['direct_uri' => $url],"redirect");
         }
 

+ 4 - 26
mobile/wxauthor.php

@@ -58,11 +58,9 @@ else
     else
     {
         $host = urldecode($state);
-        $param =  explode('_',$host);
-        if(count($param) == 1){
-            $url = "{$host}/mobile/wxauthor.php?code={$code}&state={$state}";
-            Log::record("redirect url={$url}",Log::DEBUG);
-            $html = "<!DOCTYPE html>
+        $url = "{$host}/mobile/wxauthor.php?code={$code}&state={$state}";
+        Log::record("redirect url={$url}",Log::DEBUG);
+        $html = "<!DOCTYPE html>
                         <html lang=\"en\">
                         <head>
                             <meta charset=\"UTF-8\">
@@ -75,27 +73,7 @@ else
                         </body>
                         </html>";
 
-            echo $html;
-        }else{
-            $domain = $param[0];
-            $act = $param[1];
-            $op  = $param[2];
-            $url = $domain."/mobile/index.php?act={$act}&op={$op}";
-            Log::record("redirect url={$url}",Log::DEBUG);
-            $html = "<!DOCTYPE html>
-                        <html lang=\"en\">
-                        <head>
-                            <meta charset=\"UTF-8\">
-                            <title>跳转中</title>
-                        </head>
-                        <body>
-                        <script>
-                            window.location.href =\"{$url}\";
-                        </script>
-                        </body>
-                        </html>";
+        echo $html;
 
-            echo $html;
-        }
     }
 }