|
|
@@ -1216,23 +1216,14 @@ class wxUtil
|
|
|
$accessToken = self::getMiniProgramAccessToken($merchant);
|
|
|
$url = "https://api.weixin.qq.com/wxa/modify_domain?access_token=" . $accessToken;
|
|
|
$curl = new curl\Curl();
|
|
|
- if ($merchant['merchantName'] == '花美灵') {
|
|
|
- $data = [
|
|
|
- "action" => "set",
|
|
|
- "requestdomain" => ['https://mini.huaml.com'],
|
|
|
- "wsrequestdomain" => ['https://mini.huaml.com'],
|
|
|
- "uploaddomain" => ['https://mini.huaml.com'],
|
|
|
- "downloaddomain" => ['https://mini.huaml.com'],
|
|
|
- ];
|
|
|
- } else {
|
|
|
- $data = [
|
|
|
- "action" => "set",
|
|
|
- "requestdomain" => ['https://mini.huahb.com'],
|
|
|
- "wsrequestdomain" => ['https://mini.huahb.com'],
|
|
|
- "uploaddomain" => ['https://mini.huahb.com'],
|
|
|
- "downloaddomain" => ['https://mini.huahb.com'],
|
|
|
- ];
|
|
|
- }
|
|
|
+ $mHost = Yii::$app->params['mHost'];
|
|
|
+ $data = [
|
|
|
+ "action" => "set",
|
|
|
+ "requestdomain" => [$mHost],
|
|
|
+ "wsrequestdomain" => [$mHost],
|
|
|
+ "uploaddomain" => [$mHost],
|
|
|
+ "downloaddomain" => [$mHost],
|
|
|
+ ];
|
|
|
$result = $curl->setOption(CURLOPT_POSTFIELDS, Json::encode($data))->post($url);
|
|
|
$respond = Json::decode($result);
|
|
|
print_r($respond);
|
|
|
@@ -1244,17 +1235,11 @@ class wxUtil
|
|
|
$accessToken = self::getMiniProgramAccessToken($merchant);
|
|
|
$url = "https://api.weixin.qq.com/wxa/setwebviewdomain?access_token=" . $accessToken;
|
|
|
$curl = new curl\Curl();
|
|
|
- if ($merchant['merchantName'] == '花美灵') {
|
|
|
- $data = [
|
|
|
- "action" => "set",
|
|
|
- "webviewdomain" => ['https://mini.huaml.com'],
|
|
|
- ];
|
|
|
- } else {
|
|
|
- $data = [
|
|
|
- "action" => "set",
|
|
|
- "webviewdomain" => ['https://mini.huahb.com'],
|
|
|
- ];
|
|
|
- }
|
|
|
+ $mHost = Yii::$app->params['mHost'];
|
|
|
+ $data = [
|
|
|
+ "action" => "set",
|
|
|
+ "webviewdomain" => [$mHost],
|
|
|
+ ];
|
|
|
$result = $curl->setOption(CURLOPT_POSTFIELDS, Json::encode($data))->post($url);
|
|
|
$respond = Json::decode($result);
|
|
|
print_r($respond);
|