From a74522a7e3b7e66d8fefe56c7cf3da2b4c2ed380 Mon Sep 17 00:00:00 2001 From: Chaim Date: Fri, 17 Jul 2020 22:35:00 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 5 +- src/ApiController.php | 3 - src/Controller.php | 4 +- src/cache/Mysql.php | 33 +++++----- src/common.php | 2 +- src/exception/ThinkException.php | 4 +- src/helper/Arrays.php | 4 +- src/helper/Files.php | 8 ++- src/service/QqWryService.php | 21 +++++-- src/service/StorageService.php | 4 +- src/service/crypt/AesService.php | 4 +- src/service/douyin/WatermarkService.php | 83 ++++++++++++++++--------- src/service/pinduoduo/JinBaoService.php | 7 ++- src/service/wechat/MiniService.php | 12 ++-- src/service/wechat/WebAppService.php | 16 +++-- 15 files changed, 138 insertions(+), 72 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7722c79..a36bb55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ +## v6.0.87 / 2020-07-17 +- 优化代码 + ## v6.0.86 / 2020-07-17 -- 扩优化代码 +- 优化代码 ## v6.0.85 / 2020-07-17 - 扩展包不再包含数据库文件,允许通过配置文件路径的方式 diff --git a/src/ApiController.php b/src/ApiController.php index 699409c..6a5abfb 100644 --- a/src/ApiController.php +++ b/src/ApiController.php @@ -79,7 +79,6 @@ class ApiController extends stdClass */ public function error($msg = 'error', $code = 1, $data = []) { - if ($data === []) $data = new stdClass(); throw new HttpResponseException(json([ 'code' => $code, 'msg' => $msg, 'timestamp' => time(), 'data' => $data, ])); @@ -93,7 +92,6 @@ class ApiController extends stdClass */ public function success($data = [], $msg = 'success', $code = 0) { - if ($data === []) $data = new stdClass(); throw new HttpResponseException(json([ 'code' => $code, 'msg' => $msg, 'timestamp' => time(), 'data' => $data, ])); @@ -108,7 +106,6 @@ class ApiController extends stdClass */ public function aesSuccess($data = [], $msg = 'success', $code = 0, $name = 'sniff_h5') { - if ($data === []) $data = new stdClass(); $timestamp = time(); throw new HttpResponseException(json([ 'code' => $code, 'msg' => $msg, 'timestamp' => $timestamp, 'data' => [ diff --git a/src/Controller.php b/src/Controller.php index a1e4f35..96e225b 100644 --- a/src/Controller.php +++ b/src/Controller.php @@ -126,7 +126,9 @@ class Controller extends stdClass $this->$name = $value; } elseif (is_array($name)) { foreach ($name as $k => $v) { - if (is_string($k)) $this->$k = $v; + if (is_string($k)) { + $this->$k = $v; + } } } return $this; diff --git a/src/cache/Mysql.php b/src/cache/Mysql.php index 3ea4d9e..298fe6b 100644 --- a/src/cache/Mysql.php +++ b/src/cache/Mysql.php @@ -66,7 +66,7 @@ class Mysql */ public function set($cache_value) { - if (empty($this->cache_name)) throw new DtaException("名称未配置"); + $this->judge(); $result = Db::table($this->table) ->insert([ 'cache_name' => $this->cache_name, @@ -84,12 +84,11 @@ class Mysql * @return string * @throws DataNotFoundException * @throws DbException - * @throws DtaException - * @throws ModelNotFoundException + * @throws ModelNotFoundException|DtaException */ public function get() { - if (empty($this->cache_name)) throw new DtaException("名称未配置"); + $this->judge(); $cache = Db::table($this->table) ->where('cache_name', $this->cache_name) ->order('id desc') @@ -101,12 +100,11 @@ class Mysql /** * 删除 * @return int - * @throws DbException - * @throws DtaException + * @throws DbException|DtaException */ public function delete() { - if (empty($this->cache_name)) throw new DtaException("名称未配置"); + $this->judge(); $result = Db::table($this->table) ->where('cache_name', $this->cache_name) ->delete(); @@ -120,12 +118,11 @@ class Mysql * 更新 * @param $cache_value * @return int - * @throws DbException - * @throws DtaException + * @throws DbException|DtaException */ public function update($cache_value) { - if (empty($this->cache_name)) throw new DtaException("名称未配置"); + $this->judge(); $result = Db::table($this->table) ->where('cache_name', $this->cache_name) ->update([ @@ -144,8 +141,7 @@ class Mysql * @return int * @throws DataNotFoundException * @throws DbException - * @throws DtaException - * @throws ModelNotFoundException + * @throws ModelNotFoundException|DtaException */ public function inc(int $int = 1) { @@ -167,8 +163,7 @@ class Mysql * @return int * @throws DataNotFoundException * @throws DbException - * @throws DtaException - * @throws ModelNotFoundException + * @throws ModelNotFoundException|DtaException */ public function dec(int $int = 1) { @@ -183,4 +178,14 @@ class Mysql } return true; } + + /** + * @throws DtaException + */ + private function judge() + { + if (empty($this->cache_name)) { + throw new DtaException("名称未配置"); + } + } } diff --git a/src/common.php b/src/common.php index be22e67..4dfc6a8 100644 --- a/src/common.php +++ b/src/common.php @@ -28,7 +28,7 @@ use think\db\exception\ModelNotFoundException; /** * 定义当前版本 */ -const VERSION = '6.0.86'; +const VERSION = '6.0.87'; if (!function_exists('get_ip_info')) { /** diff --git a/src/exception/ThinkException.php b/src/exception/ThinkException.php index 0aae6d2..e8f0450 100644 --- a/src/exception/ThinkException.php +++ b/src/exception/ThinkException.php @@ -69,7 +69,9 @@ class ThinkException extends Handle */ private function show($msg) { - if (empty($msg)) return true; + if (empty($msg)) { + return true; + } $nt = config('dtapp.exception.type', ''); if (!empty($nt) && $nt == 'dingtalk') { $access_token = config('dtapp.exception.dingtalk.access_token', ''); diff --git a/src/helper/Arrays.php b/src/helper/Arrays.php index abc0a74..c2e7542 100644 --- a/src/helper/Arrays.php +++ b/src/helper/Arrays.php @@ -57,7 +57,9 @@ class Arrays public function split(array $array, $num = 5): array { $arrRet = array(); - if (!isset($array) || empty($array)) return $arrRet; + if (!isset($array) || empty($array)) { + return $arrRet; + } $iCount = count($array) / $num; if (!is_int($iCount)) { $iCount = ceil($iCount); diff --git a/src/helper/Files.php b/src/helper/Files.php index 054d185..a77c9fe 100644 --- a/src/helper/Files.php +++ b/src/helper/Files.php @@ -58,7 +58,9 @@ class Files */ public function deletes(string $name): bool { - if (empty($name)) throw new Exception('请检查需要删除文件夹的名称'); + if (empty($name)) { + throw new Exception('请检查需要删除文件夹的名称'); + } //先删除目录下的文件: $dh = opendir($name); while ($file = readdir($dh)) { @@ -90,7 +92,9 @@ class Files */ public function folderZip(string $name, string $suffix_name = '.png', string $file_name = '*'): bool { - if (empty($name)) throw new Exception('请检查需要打包的路径名称'); + if (empty($name)) { + throw new Exception('请检查需要打包的路径名称'); + } try { // 获取目录下所有某个结尾的文件列表 $list = glob($name . "{$file_name}.{$suffix_name}"); diff --git a/src/service/QqWryService.php b/src/service/QqWryService.php index 7def156..d696b85 100644 --- a/src/service/QqWryService.php +++ b/src/service/QqWryService.php @@ -75,7 +75,9 @@ class QqWryService extends Service public function __construct(App $app) { $this->ipPath = config('dtapp.ip_path', ''); - if (empty($this->ipPath)) throw new DtaException('请检查配置文件是否配置了IP数据库文件存放位置'); + if (empty($this->ipPath)) { + throw new DtaException('请检查配置文件是否配置了IP数据库文件存放位置'); + } $this->fp = 0; if (($this->fp = fopen($this->ipPath . 'qqwry.dat', 'rb')) !== false) { $this->firstIp = $this->getLong(); @@ -157,7 +159,10 @@ class QqWryService extends Service } static $locationData = []; if (!isset($locationData[$ip])) { - if (!$this->fp) throw new DtaException('数据库文件不存在!'); // 如果数据文件没有被正确打开,则直接返回错误 + if (!$this->fp) { + // 如果数据文件没有被正确打开,则直接返回错误 + throw new DtaException('数据库文件不存在!'); + } $location['ip'] = $ip; // 将输入的域名转化为IP地址 $ip = $this->packIp($location['ip']); // 将输入的IP地址转化为可比较的IP地址 // 不合法的IP地址会被转化为255.255.255.255 @@ -221,8 +226,12 @@ class QqWryService extends Service break; } // CZ88.NET表示没有有效信息 - if (trim($location['all']) == 'CZ88.NET') $location['all'] = $this->unknown; - if (trim($location['extend']) == 'CZ88.NET') $location['extend'] = ''; + if (trim($location['all']) == 'CZ88.NET') { + $location['all'] = $this->unknown; + } + if (trim($location['extend']) == 'CZ88.NET') { + $location['extend'] = ''; + } $location['all'] = iconv("gb2312", "UTF-8//IGNORE", $location['all']); $location['extend'] = iconv("gb2312", "UTF-8//IGNORE", $location['extend']); $location['extend'] = $location['extend'] === null ? '' : $location['extend']; @@ -359,7 +368,9 @@ class QqWryService extends Service */ public function __destruct() { - if ($this->fp) fclose($this->fp); + if ($this->fp) { + fclose($this->fp); + } $this->fp = 0; } diff --git a/src/service/StorageService.php b/src/service/StorageService.php index c78bf10..abd76db 100644 --- a/src/service/StorageService.php +++ b/src/service/StorageService.php @@ -130,7 +130,9 @@ class StorageService extends Service */ public function bytes(string $name) { - if (empty($this->path)) $this->getConfig(); + if (empty($this->path)) { + $this->getConfig(); + } $bytes = filesize($this->path . $name); if ($bytes >= 1073741824) { $bytes = round($bytes / 1073741824 * 100) / 100 . 'GB'; diff --git a/src/service/crypt/AesService.php b/src/service/crypt/AesService.php index 17dea0f..a681976 100644 --- a/src/service/crypt/AesService.php +++ b/src/service/crypt/AesService.php @@ -44,7 +44,9 @@ class AesService extends Service */ public function encrypt($data) { - if (!empty(is_array($data))) $data = json_encode($data, JSON_UNESCAPED_UNICODE); + if (!empty(is_array($data))) { + $data = json_encode($data, JSON_UNESCAPED_UNICODE); + } return urlencode(base64_encode(openssl_encrypt($data, 'AES-128-CBC', $this->key, 1, $this->iv))); } diff --git a/src/service/douyin/WatermarkService.php b/src/service/douyin/WatermarkService.php index 0e8e2c0..e6b9ea4 100644 --- a/src/service/douyin/WatermarkService.php +++ b/src/service/douyin/WatermarkService.php @@ -249,11 +249,14 @@ class WatermarkService extends Service ->remotely($backtrack['music_info']['avatar']) ->save($backtrack['music_info']['mid'] . ".jpeg"); // 音频文件 - if (!empty($backtrack['music_info']['play'])) $music_info_play = StorageService::instance() - ->path($this->storagePath) - ->remotely($backtrack['music_info']['play']) - ->save($backtrack['music_info']['mid'] . ".mp3"); - else $music_info_play = ['size' => '0kb']; + if (!empty($backtrack['music_info']['play'])) { + $music_info_play = StorageService::instance() + ->path($this->storagePath) + ->remotely($backtrack['music_info']['play']) + ->save($backtrack['music_info']['mid'] . ".mp3"); + } else { + $music_info_play = ['size' => '0kb']; + } // 音频封面 $music_info_cover = StorageService::instance() ->path($this->storagePath) @@ -299,9 +302,12 @@ class WatermarkService extends Service $backtrack['yun']['music_info']['avatar'] = OssService::instance() ->upload($yun_path . $backtrack['music_info']['mid'] . ".jpeg", $system_path . $backtrack['music_info']['mid'] . ".jpeg"); // 音频文件 - if (!empty($backtrack['music_info']['play'])) $backtrack['yun']['music_info']['play'] = OssService::instance() - ->upload($yun_path . $backtrack['music_info']['mid'] . ".mp3", $system_path . $backtrack['music_info']['mid'] . ".mp3"); - else $backtrack['yun']['music_info']['play'] = ''; + if (!empty($backtrack['music_info']['play'])) { + $backtrack['yun']['music_info']['play'] = OssService::instance() + ->upload($yun_path . $backtrack['music_info']['mid'] . ".mp3", $system_path . $backtrack['music_info']['mid'] . ".mp3"); + } else { + $backtrack['yun']['music_info']['play'] = ''; + } // 音频封面 $backtrack['yun']['music_info']['cover'] = OssService::instance() ->upload($yun_path . $backtrack['music_info']['mid'] . "_cover" . ".jpeg", $system_path . $backtrack['music_info']['mid'] . "_cover" . ".jpeg"); @@ -329,9 +335,12 @@ class WatermarkService extends Service $backtrack['yun']['music_info']['avatar'] = CosService::instance() ->upload($yun_path . $backtrack['music_info']['mid'] . ".jpeg", $system_path . $backtrack['music_info']['mid'] . ".jpeg"); // 音频文件 - if (!empty($backtrack['music_info']['play'])) $backtrack['yun']['music_info']['play'] = CosService::instance() - ->upload($yun_path . $backtrack['music_info']['mid'] . ".mp3", $system_path . $backtrack['music_info']['mid'] . ".mp3"); - else $backtrack['yun']['music_info']['play'] = ''; + if (!empty($backtrack['music_info']['play'])) { + $backtrack['yun']['music_info']['play'] = CosService::instance() + ->upload($yun_path . $backtrack['music_info']['mid'] . ".mp3", $system_path . $backtrack['music_info']['mid'] . ".mp3"); + } else { + $backtrack['yun']['music_info']['play'] = ''; + } // 音频封面 $backtrack['yun']['music_info']['cover'] = CosService::instance() ->upload($yun_path . $backtrack['music_info']['mid'] . "_cover" . ".jpeg", $system_path . $backtrack['music_info']['mid'] . "_cover" . ".jpeg"); @@ -359,9 +368,12 @@ class WatermarkService extends Service $backtrack['yun']['music_info']['avatar'] = ObsService::instance() ->upload($yun_path . $backtrack['music_info']['mid'] . ".jpeg", $system_path . $backtrack['music_info']['mid'] . ".jpeg"); // 音频文件 - if (!empty($backtrack['music_info']['play'])) $backtrack['yun']['music_info']['play'] = ObsService::instance() - ->upload($yun_path . $backtrack['music_info']['mid'] . ".mp3", $system_path . $backtrack['music_info']['mid'] . ".mp3"); - else $backtrack['yun']['music_info']['play'] = ''; + if (!empty($backtrack['music_info']['play'])) { + $backtrack['yun']['music_info']['play'] = ObsService::instance() + ->upload($yun_path . $backtrack['music_info']['mid'] . ".mp3", $system_path . $backtrack['music_info']['mid'] . ".mp3"); + } else { + $backtrack['yun']['music_info']['play'] = ''; + } // 音频封面 $backtrack['yun']['music_info']['cover'] = ObsService::instance() ->upload($yun_path . $backtrack['music_info']['mid'] . "_cover" . ".jpeg", $system_path . $backtrack['music_info']['mid'] . "_cover" . ".jpeg"); @@ -389,9 +401,12 @@ class WatermarkService extends Service $backtrack['yun']['music_info']['avatar'] = BosService::instance() ->upload($yun_path . $backtrack['music_info']['mid'] . ".jpeg", $system_path . $backtrack['music_info']['mid'] . ".jpeg"); // 音频文件 - if (!empty($backtrack['music_info']['play'])) $backtrack['yun']['music_info']['play'] = BosService::instance() - ->upload($yun_path . $backtrack['music_info']['mid'] . ".mp3", $system_path . $backtrack['music_info']['mid'] . ".mp3"); - else $backtrack['yun']['music_info']['play'] = ''; + if (!empty($backtrack['music_info']['play'])) { + $backtrack['yun']['music_info']['play'] = BosService::instance() + ->upload($yun_path . $backtrack['music_info']['mid'] . ".mp3", $system_path . $backtrack['music_info']['mid'] . ".mp3"); + } else { + $backtrack['yun']['music_info']['play'] = ''; + } // 音频封面 $backtrack['yun']['music_info']['cover'] = BosService::instance() ->upload($yun_path . $backtrack['music_info']['mid'] . "_cover" . ".jpeg", $system_path . $backtrack['music_info']['mid'] . "_cover" . ".jpeg"); @@ -419,9 +434,12 @@ class WatermarkService extends Service $backtrack['yun']['music_info']['avatar'] = KodoService::instance() ->upload($yun_path . $backtrack['music_info']['mid'] . ".jpeg", $system_path . $backtrack['music_info']['mid'] . ".jpeg"); // 音频文件 - if (!empty($backtrack['music_info']['play'])) $backtrack['yun']['music_info']['play'] = KodoService::instance() - ->upload($yun_path . $backtrack['music_info']['mid'] . ".mp3", $system_path . $backtrack['music_info']['mid'] . ".mp3"); - else $backtrack['yun']['music_info']['play'] = ''; + if (!empty($backtrack['music_info']['play'])) { + $backtrack['yun']['music_info']['play'] = KodoService::instance() + ->upload($yun_path . $backtrack['music_info']['mid'] . ".mp3", $system_path . $backtrack['music_info']['mid'] . ".mp3"); + } else { + $backtrack['yun']['music_info']['play'] = ''; + } // 音频封面 $backtrack['yun']['music_info']['cover'] = KodoService::instance() ->upload($yun_path . $backtrack['music_info']['mid'] . "_cover" . ".jpeg", $system_path . $backtrack['music_info']['mid'] . "_cover" . ".jpeg"); @@ -449,9 +467,12 @@ class WatermarkService extends Service $backtrack['yun']['music_info']['avatar'] = UssService::instance() ->upload($yun_path . $backtrack['music_info']['mid'] . ".jpeg", $system_path . $backtrack['music_info']['mid'] . ".jpeg"); // 音频文件 - if (!empty($backtrack['music_info']['play'])) $backtrack['yun']['music_info']['play'] = UssService::instance() - ->upload($yun_path . $backtrack['music_info']['mid'] . ".mp3", $system_path . $backtrack['music_info']['mid'] . ".mp3"); - else $backtrack['yun']['music_info']['play'] = ''; + if (!empty($backtrack['music_info']['play'])) { + $backtrack['yun']['music_info']['play'] = UssService::instance() + ->upload($yun_path . $backtrack['music_info']['mid'] . ".mp3", $system_path . $backtrack['music_info']['mid'] . ".mp3"); + } else { + $backtrack['yun']['music_info']['play'] = ''; + } // 音频封面 $backtrack['yun']['music_info']['cover'] = UssService::instance() ->upload($yun_path . $backtrack['music_info']['mid'] . "_cover" . ".jpeg", $system_path . $backtrack['music_info']['mid'] . "_cover" . ".jpeg"); @@ -479,9 +500,12 @@ class WatermarkService extends Service $backtrack['yun']['music_info']['avatar'] = Ks3Service::instance() ->upload($yun_path . $backtrack['music_info']['mid'] . ".jpeg", $system_path . $backtrack['music_info']['mid'] . ".jpeg"); // 音频文件 - if (!empty($backtrack['music_info']['play'])) $backtrack['yun']['music_info']['play'] = Ks3Service::instance() - ->upload($yun_path . $backtrack['music_info']['mid'] . ".mp3", $system_path . $backtrack['music_info']['mid'] . ".mp3"); - else $backtrack['yun']['music_info']['play'] = ''; + if (!empty($backtrack['music_info']['play'])) { + $backtrack['yun']['music_info']['play'] = Ks3Service::instance() + ->upload($yun_path . $backtrack['music_info']['mid'] . ".mp3", $system_path . $backtrack['music_info']['mid'] . ".mp3"); + } else { + $backtrack['yun']['music_info']['play'] = ''; + } // 音频封面 $backtrack['yun']['music_info']['cover'] = Ks3Service::instance() ->upload($yun_path . $backtrack['music_info']['mid'] . "_cover" . ".jpeg", $system_path . $backtrack['music_info']['mid'] . "_cover" . ".jpeg"); @@ -510,8 +534,11 @@ class WatermarkService extends Service // 音频头像 $backtrack['yun']['music_info']['avatar'] = $new_yun_path . $backtrack['music_info']['mid'] . ".jpeg"; // 音频文件 - if (!empty($backtrack['music_info']['play'])) $backtrack['yun']['music_info']['play'] = $new_yun_path . $backtrack['music_info']['mid'] . ".mp3"; - else $backtrack['yun']['music_info']['play'] = $new_yun_path; + if (!empty($backtrack['music_info']['play'])) { + $backtrack['yun']['music_info']['play'] = $new_yun_path . $backtrack['music_info']['mid'] . ".mp3"; + } else { + $backtrack['yun']['music_info']['play'] = $new_yun_path; + } // 音频封面 $backtrack['yun']['music_info']['cover'] = $new_yun_path . $backtrack['music_info']['mid'] . "_cover" . ".jpeg"; // 视频封面 diff --git a/src/service/pinduoduo/JinBaoService.php b/src/service/pinduoduo/JinBaoService.php index fbf142c..0757fda 100644 --- a/src/service/pinduoduo/JinBaoService.php +++ b/src/service/pinduoduo/JinBaoService.php @@ -494,8 +494,11 @@ class JinBaoService extends Service */ private function object2array(&$object) { - if (is_object($object)) $arr = (array)($object); - else $arr = &$object; + if (is_object($object)) { + $arr = (array)($object); + } else { + $arr = &$object; + } if (is_array($arr)) { foreach ($arr as $varName => $varValue) { $arr[$varName] = $this->object2array($varValue); diff --git a/src/service/wechat/MiniService.php b/src/service/wechat/MiniService.php index 8ff7eff..74e546d 100644 --- a/src/service/wechat/MiniService.php +++ b/src/service/wechat/MiniService.php @@ -440,11 +440,13 @@ class MiniService extends Service $file = "{$this->app->getRootPath()}runtime/{$this->app_id}_access_token.json"; // 获取数据 $accessToken = file_exists($file) ? json_decode(file_get_contents($file), true) : []; - if (empty($accessToken) || !is_array($accessToken)) $accessToken = [ - 'access_token' => '', - 'expires_in' => '', - 'expires_time' => '', - ]; + if (empty($accessToken) || !is_array($accessToken)) { + $accessToken = [ + 'access_token' => '', + 'expires_in' => '', + 'expires_time' => '', + ]; + } if (empty($accessToken['expires_time'])) { $accessToken_res = HttpService::instance() ->url("{$this->api_url}cgi-bin/token?grant_type={$this->grant_type}&appid={$this->app_id}&secret={$this->app_secret}") diff --git a/src/service/wechat/WebAppService.php b/src/service/wechat/WebAppService.php index 62449f3..dad10e6 100644 --- a/src/service/wechat/WebAppService.php +++ b/src/service/wechat/WebAppService.php @@ -316,7 +316,9 @@ class WebAppService extends Service } // 获取数据 $accessToken = $this->getAccessToken(); - if (!isset($accessToken['access_token'])) throw new DtaException("获取access_token错误," . $accessToken['errmsg']); + if (!isset($accessToken['access_token'])) { + throw new DtaException("获取access_token错误," . $accessToken['errmsg']); + } $res = HttpService::instance() ->url("{$this->api_url}cgi-bin/ticket/getticket?access_token={$accessToken['access_token']}&type=jsapi") ->toArray(); @@ -643,11 +645,13 @@ class WebAppService extends Service $file = "{$this->app->getRootPath()}runtime/{$this->app_id}_access_token.json"; // 获取数据 $accessToken = file_exists($file) ? json_decode(file_get_contents($file), true) : []; - if (empty($accessToken) || !is_array($accessToken)) $accessToken = [ - 'access_token' => '', - 'expires_in' => '', - 'expires_time' => '', - ]; + if (empty($accessToken) || !is_array($accessToken)) { + $accessToken = [ + 'access_token' => '', + 'expires_in' => '', + 'expires_time' => '', + ]; + } if (empty($accessToken['expires_time'])) { // 文件不存在 $accessToken_res = HttpService::instance()