feat(hwobs): 返回华为obs参数

This commit is contained in:
2025-05-18 10:47:10 +08:00
parent e420668a44
commit 6c4fc6bff6
3 changed files with 24 additions and 18 deletions

View File

@@ -30,7 +30,7 @@ return [
'title' => '存储桶名称',
'type' => 'string',
'content' => [],
'value' => 'zhongyi542',
'value' => 'doxixi',
'rule' => 'required',
'msg' => '',
'tip' => '存储桶名称',
@@ -54,7 +54,7 @@ return [
'title' => '上传接口地址',
'type' => 'string',
'content' => [],
'value' => 'https://zhongyi542.obs.cn-south-1.myhuaweicloud.com',
'value' => 'https://doxixi.obs.cn-south-1.myhuaweicloud.com',
'rule' => 'required;uploadurl',
'msg' => '',
'tip' => '请使用存储桶->基本信息->访问域名的值并在前面加上http://或https://',
@@ -66,7 +66,7 @@ return [
'title' => 'CDN地址',
'type' => 'string',
'content' => [],
'value' => 'https://zhongyi542.obs.cn-south-1.myhuaweicloud.com',
'value' => 'https://doxixi.obs.cn-south-1.myhuaweicloud.com',
'rule' => 'required;cdnurl',
'msg' => '',
'tip' => '如果你的云存储有绑定自定义域名,请输入自定义域名',
@@ -183,7 +183,7 @@ return [
1 => '开启',
0 => '关闭',
],
'value' => '0',
'value' => '1',
'rule' => 'required',
'msg' => '',
'tip' => '',
@@ -235,7 +235,7 @@ return [
'index' => '前台',
'admin' => '后台',
],
'value' => '',
'value' => 'api,index',
'rule' => '',
'msg' => '',
'tip' => '',

View File

@@ -2,16 +2,17 @@
namespace addons\hwobs\controller;
use addons\hwobs\library\Auth;
use addons\hwobs\library\Signer;
use app\common\exception\UploadException;
use app\common\library\Upload;
use app\common\model\Attachment;
use Obs\Internal\Common\Model;
use Obs\Internal\Signature\DefaultSignature;
use Obs\ObsClient;
use think\addons\Controller;
use think\Config;
use Obs\ObsClient;
use addons\hwobs\Hwobs;
use think\addons\Controller;
use addons\hwobs\library\Auth;
use app\common\library\Upload;
use Obs\Internal\Common\Model;
use addons\hwobs\library\Signer;
use app\common\model\Attachment;
use app\common\exception\UploadException;
use Obs\Internal\Signature\DefaultSignature;
class Index extends Controller
{
@@ -31,6 +32,13 @@ class Index extends Controller
$this->error("当前插件暂无前台页面");
}
public function config()
{
$upload = [];
(new Hwobs)->uploadConfigInit($upload);
$this->success('', null, $upload);
}
public function params()
{
$this->check();
@@ -83,8 +91,7 @@ class Index extends Controller
$signature = $obs->createPostSignature([
'Bucket' => $config['bucket'],
'Key' => $key,
'FormParams' => [
]
'FormParams' => []
]);
$params['key'] = $key;
$params['AccessKeyId'] = $config['accessKey'];
@@ -328,5 +335,4 @@ class Index extends Controller
$this->error("请求已经超时");
}
}
}