|
|
@@ -1560,6 +1560,23 @@ class miniUtil
|
|
|
return $behind . $fileName;
|
|
|
}
|
|
|
|
|
|
+ public static function generateShortLink($merchant, $ptStyle = 0, $pageUrl, $pageTitle)
|
|
|
+ {
|
|
|
+ $accessToken = self::getMiniProgramAccessToken($merchant, $ptStyle);
|
|
|
+ $url = "https://api.weixin.qq.com/wxa/genwxashortlink?access_token={$accessToken}";
|
|
|
+ $curl = new curl\Curl();
|
|
|
+ $data = [
|
|
|
+ "page_url" => $pageUrl,
|
|
|
+ "page_title" => $pageTitle,
|
|
|
+ 'is_permanent' => false,
|
|
|
+ ];
|
|
|
+ $result = $curl->setOption(CURLOPT_POSTFIELDS, Json::encode($data))->post($url);
|
|
|
+ $result = Json::decode($result);
|
|
|
+ echo "<pre>";
|
|
|
+ print_r($result);
|
|
|
+ die;
|
|
|
+ }
|
|
|
+
|
|
|
//小程序码生成,永久有效,数量暂无限制 ssh 2020.4.17
|
|
|
public static function generateUnlimitedMiniCode($merchant, $page, $scene = '', $ptStyle = 0)
|
|
|
{
|