think-orm
This commit is contained in:
@@ -22,7 +22,7 @@ class Alioss extends Backend
|
||||
if(empty($file)) {
|
||||
$this->error('参数不能为空');
|
||||
}
|
||||
$commoninfo = Db::connect(config('database.search_library'));
|
||||
$commoninfo = Db::connect(config('think-orm.search_library'));
|
||||
$endpoint = $commoninfo->name('common_info')->where(['type' => 68])->find()['value'];
|
||||
$accessKeyId = $commoninfo->name('common_info')->where(['type' => 69])->find()['value'];
|
||||
$secretAccessKey = $commoninfo->name('common_info')->where(['type' => 70])->find()['value'];
|
||||
@@ -54,7 +54,7 @@ class Alioss extends Backend
|
||||
'Content-Encoding' => 'binary',
|
||||
];
|
||||
$res = $ossClient->putObject($bucket, $object, $content, $options);
|
||||
Log::write('上传文件结果' . json_encode($res));
|
||||
Log::info('上传文件结果' . json_encode($res));
|
||||
if(!empty($res['info'])) {
|
||||
return $this->ApiDataReturn(['data' => $befor_url . '/' . $object, 'msg' => 'success', 'code' => 0]);
|
||||
}else {
|
||||
@@ -68,7 +68,7 @@ class Alioss extends Backend
|
||||
// 获取阿里云oss存储相关配置
|
||||
public function getCredentials()
|
||||
{
|
||||
$commoninfo = Db::connect(config('database.search_library'));
|
||||
$commoninfo = Db::connect(config('think-orm.search_library'));
|
||||
$configItems = $commoninfo->name('common_info')->whereIn('type', [66, 67, 69, 70])
|
||||
->column('value', 'type');
|
||||
AlibabaCloud::accessKeyClient($configItems[69], $configItems[70])
|
||||
|
||||
Reference in New Issue
Block a user