dever 6 years ago
parent
commit
7c3a03cec4
2 changed files with 15 additions and 1 deletions
  1. 3 1
      lib/Wechat.php
  2. 12 0
      src/Api.php

+ 3 - 1
lib/Wechat.php

@@ -143,7 +143,9 @@ class Wechat extends Core
 	{
 		if (isset($order['mweb_url'])) {
 			$order['mweb_url'] .= '&redirect_url=' . $refer;
-			return '<script type="text/javascript">location.href = "' . $order['mweb_url'] . '"</script>';
+			$refer = urlencode($order['mweb_url']);
+			$url = Dever::url('api.jump?refer=' . $refer, 'pay');
+			return '<script type="text/javascript">location.href = "' . $url . '"</script>';
 		}
 		$refer = urldecode($refer);
 		$tools = new \JsApiPay($this->config);

+ 12 - 0
src/Api.php

@@ -4,6 +4,18 @@ use Dever;
 
 class Api
 {
+	/**
+	 * 发起跳转
+	 *
+	 * @return mixed
+	 */
+	public function jump()
+	{
+		$url = Dever::input('refer');
+		$url = urldecode($url);
+		Dever::location($url);
+	}
+
 	/**
 	 * 发起支付 下单 获取预支付信息
 	 *