You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
think-library/README.md

129 lines
4.5 KiB

4 years ago
<img align="right" width="100" src="https://cdn.oss.liguangchun.cn/04/999e9f2f06d396968eacc10ce9bc8a.png" alt="dtApp Logo"/>
4 years ago
<h1 align="left"><a href="https://www.dtapp.net/">ThinkPHP6扩展包</a></h1>
4 years ago
4 years ago
📦 ThinkPHP6扩展包
4 years ago
[![Latest Stable Version](https://poser.pugx.org/liguangchun/think-library/v/stable)](https://packagist.org/packages/liguangchun/think-library)
[![Latest Unstable Version](https://poser.pugx.org/liguangchun/think-library/v/unstable)](https://packagist.org/packages/liguangchun/think-library)
[![Total Downloads](https://poser.pugx.org/liguangchun/think-library/downloads)](https://packagist.org/packages/liguangchun/think-library)
[![License](https://poser.pugx.org/liguangchun/think-library/license)](https://packagist.org/packages/liguangchun/think-library)
## 依赖环境
1. PHP7.1 版本及以上
4 years ago
## 安装
部分代码来自互联网,若有异议可以联系作者进行删除。
- Github仓库地址https://github.com/GC0202/ThinkLibrary
- 码云仓库地址https://gitee.com/liguangchun/ThinkLibrary
4 years ago
- gitlab仓库地址https://gitlab.com/liguangchun/thinklibrary
- 阿里云仓库地址https://code.aliyun.com/liguancghun/ThinkLibrary
- CODING仓库地址https://liguangchun-01.coding.net/p/ThinkLibrary/d/ThinkLibrary/git
- CODING仓库地址https://aizhineng.coding.net/p/ThinkLibrary/d/ThinkLibrary/git
- 腾讯云仓库地址https://liguangchundt.coding.net/p/ThinkLibrary/d/ThinkLibrary/git
- 微信仓库地址https://git.weixin.qq.com/liguangchun/ThinkLibrary
- 华为云仓库地址https://codehub-cn-south-1.devcloud.huaweicloud.com/composer00001/ThinkLibrary.git
4 years ago
### 开发版
4 years ago
```text
composer require liguangchun/think-library ^6.x-dev -vvv
```
4 years ago
### 稳定版
```text
composer require liguangchun/think-library ^6.0.* -vvv
```
4 years ago
## 更新
```text
composer update liguangchun/think-library -vvv
```
## 删除
```text
composer remove liguangchun/think-library -vvv
```
4 years ago
## 获取电脑Mac地址服务使用示例
```php
use DtApp\ThinkLibrary\service\SystemService;
4 years ago
dump(SystemService::instance()
->mac());
4 years ago
```
## 百度地图服务使用示例
```php
4 years ago
use DtApp\ThinkLibrary\service\baidu\LbsYunService;
dump(LbsYunService::instance()
4 years ago
->ak("")
->weather());
```
## 高德地图服务使用示例
```php
4 years ago
use DtApp\ThinkLibrary\service\amap\AmApService;
dump(AmApService::instance()
4 years ago
->key("")
->weather());
```
## 抖音服务使用示例
4 years ago
```php
4 years ago
use DtApp\ThinkLibrary\exception\DtaException;
use DtApp\ThinkLibrary\service\douyin\WatermarkService;
try {
// 方法一 网址
4 years ago
dump(WatermarkService::instance()->url('https://v.douyin.com/vPGAdM/')->getAll()->toArray());
// 方法一 粘贴
4 years ago
dump(WatermarkService::instance()->url('#在抖音,记录美好生活#美丽电白欢迎您 https://v.douyin.com/vPGAdM/ 复制此链接,打开【抖音短视频】,直接观看视频!')->getAll()->toArray());
// 方法二 网址
$dy = WatermarkService::instance()->url('https://v.douyin.com/vPafcr/');
4 years ago
dump($dy->getAll()->toArray());
// 方法二 粘贴
$dy = WatermarkService::instance()->url('#在抖音,记录美好生活#2020茂名加油广州加油武汉加油中国加油众志成城#航拍 #茂名#武汉 #广州 #旅拍 @抖音小助手 https://v.douyin.com/vPafcr/ 复制此链接,打开【抖音短视频】,直接观看视频!');
4 years ago
dump($dy->getAll()->toArray());
// 获取全部信息
4 years ago
dump(WatermarkService::instance()->url('https://v.douyin.com/vPGAdM/')->getAll()->toArray());
// 获取原全部信息
4 years ago
dump(WatermarkService::instance()->url('https://v.douyin.com/vPGAdM/')->getApi()->toArray());
// 获取视频信息
4 years ago
dump(WatermarkService::instance()->url('https://v.douyin.com/vPGAdM/')->getVideoInfo()->toArray());
// 获取音频信息
4 years ago
dump(WatermarkService::instance()->url('https://v.douyin.com/vPGAdM/')->getMusicInfo()->toArray());
// 获取分享信息
4 years ago
dump(WatermarkService::instance()->url('https://v.douyin.com/vPGAdM/')->getShareInfo()->toArray());
// 获取作者信息
4 years ago
dump(WatermarkService::instance()->url('https://v.douyin.com/vPGAdM/')->getAuthorInfo()->toArray());
// 返回数组数据方法
4 years ago
dump(WatermarkService::instance()->url('https://v.douyin.com/vPGAdM/')->getAll()->toArray());
// 返回Object数据方法
4 years ago
dump(WatermarkService::instance()->url('https://v.douyin.com/vPGAdM/')->getAll()->toObject());
4 years ago
} catch (DtaException $e) {
// 错误提示
4 years ago
dump($e->getMessage());
}
```