dever 6 years ago
parent
commit
dbab2606ea
1 changed files with 7 additions and 1 deletions
  1. 7 1
      lib/Wechat.php

+ 7 - 1
lib/Wechat.php

@@ -143,7 +143,13 @@ class Wechat extends Core
 	{
 		if (isset($order['mweb_url'])) {
 			$url = $order['mweb_url'] . '&redirect_url=' . $refer;
-			return '<script type="text/javascript">location.href = "' . $url . '"</script>';
+			if (!$url) {
+				$location = 'window.open("' . $url . '")';
+			} else {
+				$location = 'location.href="' . $url . '"';
+			}
+			
+			return '<script type="text/javascript">'.$location.'</script>';
 		}
 		$refer = urldecode($refer);
 		$tools = new \JsApiPay($this->config);