think-orm

This commit is contained in:
2025-08-15 10:51:00 +08:00
parent b461dab6fb
commit dc60b38526
27 changed files with 169 additions and 49 deletions

View File

@@ -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])