Explorar el Código

默认替换使用https

shish hace 6 años
padre
commit
95961ed167
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      common/services/xhWxMenuService.php

+ 6 - 1
common/services/xhWxMenuService.php

@@ -21,6 +21,12 @@ class xhWxMenuService
         self::delMenuList($merchantId);
         $menuOption = configDict::getConfig('wxMenuOption');
         $mDomain = Yii::$app->params['mDomain'];
+        $wDomain = Yii::$app->params['wDomain'];
+        //默认使用https方式
+        if (strpos($mDomain, 'https') === false) {
+            $mDomain = str_replace('http', 'https', $mDomain);
+            $wDomain = str_replace('http', 'https', $wDomain);
+        }
         $button = [
             ["type" => 'view', "name" => "鲜花速递", "menuOption" => $menuOption['redirectToCommonUseUrl'], "url" => $mDomain . '/#/?account=' . $merchantId,],
             ["type" => 'view', "name" => "会员服务", "menuOption" => $menuOption['redirectToCommonUseUrl'], "url" => $mDomain . '/#/?account=' . $merchantId,],
@@ -29,7 +35,6 @@ class xhWxMenuService
         $open = WxOpenService::getById(1);
         //如果是平台的公众号显示的菜单是不一样的
         if (isset($open['merchantId']) && $open['merchantId'] == $merchantId) {
-            $wDomain = Yii::$app->params['wDomain'];
             $button = [
                 ["type" => 'view', "name" => "官网", "menuOption" => $menuOption['redirectToCommonUseUrl'], "url" => $wDomain],
                 ["type" => "view", "name" => "快速付款", "menuOption" => $menuOption['redirectToCustomUrl'], "url" => $mDomain . '/#/pages/pay/index?account=' . $merchantId],