提交 7fb24a25 编写于 作者: 李光春's avatar 李光春

- 增加 微信小程序

上级 6fec6aea
......@@ -29,7 +29,11 @@
"topthink/framework": "^6.0.0",
"topthink/think-orm": "^2.0",
"liguangchun/ip": "^1.1",
"ext-bcmath": "*"
"ext-bcmath": "*",
"aliyuncs/oss-sdk-php": "^2.3",
"obs/esdk-obs-php": "^3.19",
"baidubce/bce-sdk-php": "^0.8.22",
"qcloud/cos-sdk-v5": "^2.0"
},
"autoload": {
"files": [
......
......@@ -14,7 +14,7 @@
// | Packagist 地址 :https://packagist.org/packages/liguangchun/think-library
// +----------------------------------------------------------------------
namespace DtApp\ThinkLibrary\service\douyin;
namespace DtApp\ThinkLibrary\exception;
use Exception;
......
<?php
// +----------------------------------------------------------------------
// | ThinkLibrary 6.0 for ThinkPhP 6.0
// +----------------------------------------------------------------------
// | 版权所有 2017~2020 [ https://www.dtapp.net ]
// +----------------------------------------------------------------------
// | 官方网站: https://gitee.com/liguangchun/ThinkLibrary
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | gitee 仓库地址 :https://gitee.com/liguangchun/ThinkLibrary
// | github 仓库地址 :https://github.com/GC0202/ThinkLibrary
// | Packagist 地址 :https://packagist.org/packages/liguangchun/think-library
// +----------------------------------------------------------------------
namespace DtApp\ThinkLibrary\service\WeMini;
use DtApp\Curl\CurlException;
use DtApp\Curl\Get;
/**
* 微信小程序 - 订阅消息
* Class NewTmplService
* @package DtApp\ThinkLibrary\service\WeMini
*/
class NewTmplService
{
/**
* 获取当前帐号下的个人模板列表
* @param $access_token
* @return bool|mixed|string
* @throws CurlException
*/
public function getTemplateList($access_token)
{
$url = "https://api.weixin.qq.com/wxaapi/newtmpl/gettemplate?access_token=ACCESS_TOKEN";
$curl = new Get();
return $curl->http(str_replace('ACCESS_TOKEN', $access_token, $url), '', true);
}
}
......@@ -16,6 +16,7 @@
namespace DtApp\ThinkLibrary\service\douyin;
use DtApp\ThinkLibrary\exception\DouYinException;
use DtApp\ThinkLibrary\facade\Pregs;
use DtApp\ThinkLibrary\Service;
use stdClass;
......@@ -238,11 +239,14 @@ class WatermarkService extends Service
* 正则匹配 mid
* @param $content
* @return mixed
* @throws DouYinException
*/
private function getItemId($content)
{
preg_match('/"(?<=itemId:\s\")\d+"/', $content, $matches);
if (!isset($matches[0])) throw new DouYinException('视频不存在');
preg_match("~\"(.*?)\"~", $matches[0], $matches2);
if (!isset($matches2[1])) throw new DouYinException('视频不存在');
return $matches2[1];
}
......@@ -250,12 +254,15 @@ class WatermarkService extends Service
* 正则匹配 dytk
* @param $content
* @return mixed
* @throws DouYinException
*/
private function getDyTk($content)
{
preg_match("~dytk(.*?)}~", $content, $matches);
if (!isset($matches[1])) throw new DouYinException('视频不存在');
$Dytk = $matches[1];
preg_match("~\"(.*?)\"~", $Dytk, $matches2);
if (!isset($matches2[1])) throw new DouYinException('视频不存在');
return $matches2[1];
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册