dever 7 years ago
parent
commit
086006e109
1 changed files with 4 additions and 1 deletions
  1. 4 1
      tm/lib/Controller/WeixinJsSDK.class.php

+ 4 - 1
tm/lib/Controller/WeixinJsSDK.class.php

@@ -42,10 +42,13 @@ class WeixinJsSDK extends Controller {
 
 		$jsapiTicket = $this->getJsApiTicket ();
 		if ($url == null) {
-			$url = "http://$_SERVER[SERVER_NAME]$_SERVER[REQUEST_URI]";
+			$url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
 		} else {
 			$url = htmlspecialchars_decode ( $url );
 		}
+
+		$url = explode('?', $url);
+		$url = $url[0];
 		
 		$timestamp = time ();
 		$nonceStr = $this->createNonceStr ();