- 优化代码

v6 v6.0.90
Chaim 4 years ago
parent 52a3dbc7f7
commit 9f18bb66d1

@ -1,3 +1,6 @@
## v6.0.90 / 2020-07-18
- 优化代码
## v6.0.89 / 2020-07-18
- 修复获取配置问题

@ -197,27 +197,23 @@ class ApiController extends stdClass
*/
public function _judgeSign($name = 'sniff_h5')
{
if (empty($this->request->header('sign', ''))) {
// 加密的数据参数
$aes = $this->request->post('aes', '');
if (empty($aes)) {
$this->error('数据未签名!', 104);
}
// 加密的数据参数
$aes = $this->request->post('aes');
// 获取时间数据
$timestamp = $this->request->get('timestamp', 0);
// 判断是否有时间
if (empty($timestamp)) {
$this->error('数据异常!', 105);
}
// 解密
$aes_decode = $this->decrypt($aes, $name, $timestamp);
if (empty($aes_decode)) {
$this->error('解密失败', 106);
}
$data = json_decode($aes_decode, true);
// 判断是不是小于服务器时间
$before = strtotime('-2minute');
$rear = strtotime('+2minute');

@ -28,7 +28,7 @@ use think\db\exception\ModelNotFoundException;
/**
* 定义当前版本
*/
const VERSION = '6.0.89';
const VERSION = '6.0.90';
if (!function_exists('get_ip_info')) {
/**

@ -58,7 +58,7 @@ class StorageService extends Service
*/
private function getConfig()
{
$this->path = $this->app->config->get('dtapp.storage.path');
$this->path = config('dtapp.storage.path');
return $this;
}

@ -40,12 +40,12 @@ class SystemService extends Service
*/
public function uri($url = '', array $vars = [], $suffix = true, $domain = false, $fillSuffix = false)
{
$default_app = $this->app->config->get('app.default_app', 'index');
$default_action = $this->app->config->get('route.default_action', 'index');
$default_controller = $this->app->config->get('route.default_controller', 'Index');
$url_html_suffix = $this->app->config->get('route.url_html_suffix', 'html');
$pathinfo_depr = $this->app->config->get('route.pathinfo_depr', '/');
$url_common_param = $this->app->config->get('route.url_common_param', true);
$default_app = config('app.default_app', 'index');
$default_action = config('route.default_action', 'index');
$default_controller = config('route.default_controller', 'Index');
$url_html_suffix = config('route.url_html_suffix', 'html');
$pathinfo_depr = config('route.pathinfo_depr', '/');
$url_common_param = config('route.url_common_param', true);
if (empty($url)) {
$url = "{$default_app}/{$default_action}/{$default_controller}";
}

@ -63,10 +63,10 @@ class OssService extends Service
*/
private function getConfig()
{
$this->accessKeyId = $this->app->config->get('dtapp.aliyun.oss.access_key_id');
$this->accessKeySecret = $this->app->config->get('dtapp.aliyun.oss.access_key_secret');
$this->endpoint = $this->app->config->get('dtapp.aliyun.oss.endpoint');
$this->bucket = $this->app->config->get('dtapp.aliyun.oss.bucket');
$this->accessKeyId = config('dtapp.aliyun.oss.access_key_id');
$this->accessKeySecret = config('dtapp.aliyun.oss.access_key_secret');
$this->endpoint = config('dtapp.aliyun.oss.endpoint');
$this->bucket = config('dtapp.aliyun.oss.bucket');
return $this;
}
@ -84,7 +84,7 @@ class OssService extends Service
try {
$ossClient = new OssClient($this->accessKeyId, $this->accessKeySecret, $this->endpoint);
$ossClient->uploadFile($this->bucket, $object, $filePath);
return $this->app->config->get('dtapp.aliyun.oss.url', '') . $object;
return config('dtapp.aliyun.oss.url', '') . $object;
} catch (OssException $e) {
return $e->getMessage();
}

@ -63,10 +63,10 @@ class BosService extends Service
*/
private function getConfig()
{
$this->accessKeyId = $this->app->config->get('dtapp.baidu.bos.access_key_id');
$this->secretAccessKey = $this->app->config->get('dtapp.baidu.bos.secret_access_key');
$this->endpoint = $this->app->config->get('dtapp.baidu.bos.endpoint');
$this->bucket = $this->app->config->get('dtapp.baidu.bos.bucket');
$this->accessKeyId = config('dtapp.baidu.bos.access_key_id');
$this->secretAccessKey = config('dtapp.baidu.bos.secret_access_key');
$this->endpoint = config('dtapp.baidu.bos.endpoint');
$this->bucket = config('dtapp.baidu.bos.bucket');
return $this;
}
@ -96,6 +96,6 @@ class BosService extends Service
$this->getConfig();
}
$client->putObjectFromFile($this->bucket, $object, $filePath);
return $this->app->config->get('dtapp.baidu.bos.url', '') . $object;
return config('dtapp.baidu.bos.url', '') . $object;
}
}

@ -57,8 +57,8 @@ class ApiService extends Service
*/
private function getConfig()
{
$this->key = $this->app->config->get('dtapp.bt.key');
$this->panel = $this->app->config->get('dtapp.bt.panel');
$this->key = config('dtapp.bt.key');
$this->panel = config('dtapp.bt.panel');
return $this;
}

@ -526,8 +526,8 @@ class WatermarkService extends Service
->upload($yun_path . $backtrack['video_info']['vid'] . "_playwm" . ".mp4", $system_path . $backtrack['video_info']['vid'] . "_playwm" . ".mp4");
break;
case "storage":
$domain_name = $this->app->config->get('dtapp.storage.domain_name');
$new_yun_path = $this->app->config->get("dtapp.storage.domain_list.{$domain_name}") . "upload/watermark/{$yun_path}";
$domain_name = config('dtapp.storage.domain_name');
$new_yun_path = config("dtapp.storage.domain_list.{$domain_name}") . "upload/watermark/{$yun_path}";
// 本地存储
// 作者头像
$backtrack['yun']['author_info']['avatar'] = "{$new_yun_path}" . $backtrack['author_info']['uid'] . ".jpeg";

@ -62,10 +62,10 @@ class ObsService extends Service
*/
private function getConfig()
{
$this->key = $this->app->config->get('dtapp.huaweicloud.obs.key');
$this->secret = $this->app->config->get('dtapp.huaweicloud.obs.secret');
$this->endpoint = $this->app->config->get('dtapp.huaweicloud.obs.endpoint');
$this->bucket = $this->app->config->get('dtapp.huaweicloud.obs.bucket');
$this->key = config('dtapp.huaweicloud.obs.key');
$this->secret = config('dtapp.huaweicloud.obs.secret');
$this->endpoint = config('dtapp.huaweicloud.obs.endpoint');
$this->bucket = config('dtapp.huaweicloud.obs.bucket');
return $this;
}
@ -95,7 +95,7 @@ class ObsService extends Service
'SourceFile' => $filePath // localfile为待上传的本地文件路径需要指定到具体的文件名
]);
if (isset($resp['RequestId'])) {
return $this->app->config->get('dtapp.huaweicloud.obs.url', '') . $object;
return config('dtapp.huaweicloud.obs.url', '') . $object;
} else {
return false;
}

@ -158,8 +158,8 @@ class UnionService extends Service
*/
private function getConfig()
{
$this->app_key = $this->app->config->get('dtapp.jd.union.app_key');
$this->secret_key = $this->app->config->get('dtapp.jd.union.secret_key');
$this->app_key = config('dtapp.jd.union.app_key');
$this->secret_key = config('dtapp.jd.union.secret_key');
return $this;
}

@ -63,10 +63,10 @@ class Ks3Service extends Service
*/
private function getConfig()
{
$this->accessKeyID = $this->app->config->get('dtapp.ksyun.ks3.access_key_iD');
$this->accessKeySecret = $this->app->config->get('dtapp.ksyun.ks3.access_key_secret');
$this->endpoint = $this->app->config->get('dtapp.ksyun.ks3.endpoint');
$this->bucket = $this->app->config->get('dtapp.ksyun.ks3.bucket');
$this->accessKeyID = config('dtapp.ksyun.ks3.access_key_iD');
$this->accessKeySecret = config('dtapp.ksyun.ks3.access_key_secret');
$this->endpoint = config('dtapp.ksyun.ks3.endpoint');
$this->bucket = config('dtapp.ksyun.ks3.bucket');
return $this;
}
@ -108,7 +108,7 @@ class Ks3Service extends Service
];
try {
$client->putObjectByFile($args);
return $this->app->config->get('dtapp.ksyun.ks3.url', '') . $object;
return config('dtapp.ksyun.ks3.url', '') . $object;
} catch (Ks3ServiceException $e) {
return false;
}

@ -152,8 +152,8 @@ class JinBaoService extends Service
*/
private function getConfig()
{
$this->client_id = $this->app->config->get('dtapp.pinduoduo.jinbao.client_id');
$this->client_secret = $this->app->config->get('dtapp.pinduoduo.jinbao.client_secret');
$this->client_id = config('dtapp.pinduoduo.jinbao.client_id');
$this->client_secret = config('dtapp.pinduoduo.jinbao.client_secret');
return $this;
}

@ -58,9 +58,9 @@ class KodoService extends Service
*/
private function getConfig()
{
$this->accessKey = $this->app->config->get('dtapp.qiniu.kodo.access_key');
$this->secretKey = $this->app->config->get('dtapp.qiniu.kodo.secret_key');
$this->bucket = $this->app->config->get('dtapp.qiniu.kodo.bucket');
$this->accessKey = config('dtapp.qiniu.kodo.access_key');
$this->secretKey = config('dtapp.qiniu.kodo.secret_key');
$this->bucket = config('dtapp.qiniu.kodo.bucket');
return $this;
}
@ -87,7 +87,7 @@ class KodoService extends Service
if ($err !== null) {
return false;
} else {
return $this->app->config->get('dtapp.qiniu.kodo.url', '') . $object;
return config('dtapp.qiniu.kodo.url', '') . $object;
}
}
}

@ -146,8 +146,8 @@ class TbkService extends Service
*/
private function getConfig()
{
$this->app_key = $this->app->config->get('dtapp.taobao.tbk.app_key');
$this->app_secret = $this->app->config->get('dtapp.taobao.tbk.app_secret');
$this->app_key = config('dtapp.taobao.tbk.app_key');
$this->app_secret = config('dtapp.taobao.tbk.app_secret');
return $this;
}

@ -63,10 +63,10 @@ class CosService extends Service
*/
private function getConfig()
{
$this->secretId = $this->app->config->get('dtapp.tencent.cos.secret_id');
$this->secretKey = $this->app->config->get('dtapp.tencent.cos.secret_key');
$this->region = $this->app->config->get('dtapp.tencent.cos.region');
$this->bucket = $this->app->config->get('dtapp.tencent.cos.bucket');
$this->secretId = config('dtapp.tencent.cos.secret_id');
$this->secretKey = config('dtapp.tencent.cos.secret_key');
$this->region = config('dtapp.tencent.cos.region');
$this->bucket = config('dtapp.tencent.cos.bucket');
return $this;
}
@ -105,6 +105,6 @@ class CosService extends Service
);
}
}
return $this->app->config->get('dtapp.tencent.cos.url', '') . $object;
return config('dtapp.tencent.cos.url', '') . $object;
}
}

@ -58,9 +58,9 @@ class UssService extends Service
*/
private function getConfig()
{
$this->serviceName = $this->app->config->get('dtapp.upyun.uss.service_name');
$this->operatorName = $this->app->config->get('dtapp.upyun.uss.operator_name');
$this->operatorPassword = $this->app->config->get('dtapp.upyun.uss.operator_password');
$this->serviceName = config('dtapp.upyun.uss.service_name');
$this->operatorName = config('dtapp.upyun.uss.operator_name');
$this->operatorPassword = config('dtapp.upyun.uss.operator_password');
return $this;
}
@ -80,6 +80,6 @@ class UssService extends Service
$client = new Upyun($serviceConfig);
$file = fopen($filePath, 'r');
$client->write($object, $file);
return $this->app->config->get('dtapp.upyun.uss.url', '') . $object;
return config('dtapp.upyun.uss.url', '') . $object;
}
}

@ -81,9 +81,9 @@ class MiniService extends Service
*/
private function getConfig()
{
$this->cache = $this->app->config->get('dtapp.wechat.mini.cache');
$this->app_id = $this->app->config->get('dtapp.wechat.mini.app_id');
$this->app_secret = $this->app->config->get('dtapp.wechat.mini.app_secret');
$this->cache = config('dtapp.wechat.mini.cache');
$this->app_id = config('dtapp.wechat.mini.app_id');
$this->app_secret = config('dtapp.wechat.mini.app_secret');
return $this;
}

@ -134,9 +134,9 @@ class WebAppService extends Service
*/
private function getConfig()
{
$this->cache = $this->app->config->get('dtapp.wechat.webapp.cache');
$this->app_id = $this->app->config->get('dtapp.wechat.webapp.app_id');
$this->app_secret = $this->app->config->get('dtapp.wechat.webapp.app_secret');
$this->cache = config('dtapp.wechat.webapp.cache');
$this->app_id = config('dtapp.wechat.webapp.app_id');
$this->app_secret = config('dtapp.wechat.webapp.app_secret');
return $this;
}

Loading…
Cancel
Save