shish 6 years ago
parent
commit
a588bc94e8
1 changed files with 5 additions and 0 deletions
  1. 5 0
      common/components/wxUtil.php

+ 5 - 0
common/components/wxUtil.php

@@ -1236,6 +1236,11 @@ class wxUtil
 		$url = "https://api.weixin.qq.com/wxa/setwebviewdomain?access_token=" . $accessToken;
 		$curl = new curl\Curl();
 		$mHost = Yii::$app->params['mHost'];
+		$has = strpos($mHost, 'https');
+		//如果不是https则换成https
+		if ($has === false) {
+			$mHost = str_replace('http', 'https', $mHost);
+		}
 		$data = [
 			"action" => "set",
 			"webviewdomain" => [$mHost],