Bläddra i källkod

debug wxauth mshop

stanley-king 6 år sedan
förälder
incheckning
cb64f89a1f
1 ändrade filer med 27 tillägg och 22 borttagningar
  1. 27 22
      mobile/control/mshop.php

+ 27 - 22
mobile/control/mshop.php

@@ -78,23 +78,25 @@ class mshopControl extends specialControl
         $this->topup();
         $goods_id = intval($_GET['goods_id']);
 
-        if($goods_id <= 0) {
-            $url = BASE_SITE_URL . "/mshop";
-        }
-        else {
-            $url = BASE_SITE_URL . "/mshop/goods_detail?goods_id={$goods_id}";
-        }
-
         $relay_id = session_helper::relay_id();
         fcgi_setcookie("relay_id","{$relay_id}",time() + 86400,'/',LOCAL_DOMAIN);
 
         if(session_helper::need_wechat_author())
         {
+            $url = url_helper::mshop_goods($goods_id);
             $author = new thrid_author\wxauthor();
             $url = $author->enter($url);
             return self::outsuccess(['direct_uri' => $url],"redirect");
         }
-        else {
+        else
+        {
+            if($goods_id <= 0) {
+                $url = BASE_SITE_URL . "/mshop";
+            }
+            else {
+                $url = BASE_SITE_URL . "/mshop/goods_detail?goods_id={$goods_id}";
+            }
+
             return self::outsuccess(['direct_uri' => $url],"redirect");
         }
     }
@@ -102,32 +104,35 @@ class mshopControl extends specialControl
     public function specialOp()
     {
         $this->topup();
+
         $special_id = intval($_GET['special_id']);
         $title = $_GET['title'];
 
-        if($special_id <= 0) {
-            $url = BASE_SITE_URL . "/mshop";
-        }
-        else
-        {
-            if(empty($title)) {
-                $title = $this->special_name($special_id);
-                $title = util::base64url_encode($title);
-            }
-
-            $url = BASE_SITE_URL . "/mshop/special?special_id={$special_id}&is_special=true&title={$title}";
-        }
-
         $relay_id = session_helper::relay_id();
         fcgi_setcookie("relay_id","{$relay_id}",time() + 86400,'/',LOCAL_DOMAIN);
 
         if(session_helper::need_wechat_author())
         {
+            $title = util::base64url_encode($title);
+            $url = BASE_SITE_URL . "/mobile/index.php?act=mshop&op=special&special_id={$special_id}&title={$title}";
             $author = new thrid_author\wxauthor();
             $url = $author->enter($url);
             return self::outsuccess(['direct_uri' => $url],"redirect");
         }
-        else {
+        else
+        {
+            if($special_id <= 0) {
+                $url = BASE_SITE_URL . "/mshop";
+            }
+            else
+            {
+                if(empty($title)) {
+                    $title = $this->special_name($special_id);
+                    $title = util::base64url_encode($title);
+                }
+
+                $url = BASE_SITE_URL . "/mshop/special?special_id={$special_id}&is_special=true&title={$title}";
+            }
             return self::outsuccess(['direct_uri' => $url],"redirect");
         }
     }