Commit f5a62acc authored by 刘小敏's avatar 刘小敏

obs临时凭证接口优化

parent c6761656
...@@ -34,18 +34,17 @@ class User extends Common ...@@ -34,18 +34,17 @@ class User extends Common
*/ */
public function getObsToken() public function getObsToken()
{ {
// 获取华为云 OBS 配置 // 获取华为云 OBS 配置(在 config.php 的 shopro 数组中)
$accessKey = config('obs.access_key', ''); $accessKey = config('shopro.obs_access_key');
$secretKey = config('obs.secret_key', ''); $secretKey = config('shopro.obs_secret_key');
$endpoint = config('obs.endpoint', ''); $endpoint = config('shopro.obs_endpoint');
$bucket = config('obs.bucket', ''); $bucket = config('shopro.obs_bucket');
// 检查配置是否完整 // 检查配置是否完整
if (empty($accessKey) || empty($secretKey) || empty($endpoint) || empty($bucket)) { if (empty($accessKey) || empty($secretKey) || empty($endpoint) || empty($bucket)) {
$this->error('OBS 配置未完成'); $this->error('OBS 配置未完成');
} }
try {
// 1. 生成上传目录(按日期分目录) // 1. 生成上传目录(按日期分目录)
$dir = 'upload/' . date('Ymd') . '/'; $dir = 'upload/' . date('Ymd') . '/';
...@@ -76,9 +75,6 @@ class User extends Common ...@@ -76,9 +75,6 @@ class User extends Common
$this->success('获取成功', $result); $this->success('获取成功', $result);
} catch (\Exception $e) {
$this->error('获取 OBS 凭证失败: ' . $e->getMessage());
}
} }
/** /**
......
...@@ -311,7 +311,7 @@ return [ ...@@ -311,7 +311,7 @@ return [
//版本号 //版本号
'version' => '1.6.2.20260323', 'version' => '1.6.2.20260323',
//API接口地址 //API接口地址
'api_url' => 'https://api.fastadmin.net', 'api_url' => 'https://www.njing.net',
], ],
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Shopro配置 // | Shopro配置
...@@ -328,11 +328,11 @@ return [ ...@@ -328,11 +328,11 @@ return [
'ai_mix' => Env::get('app.ai_mix', ''), 'ai_mix' => Env::get('app.ai_mix', ''),
'ai_hook' => Env::get('app.ai_hook', ''), 'ai_hook' => Env::get('app.ai_hook', ''),
// obs 配置
'obs_access_key' => 'HPUAWU3GPS8HEWX9JFLG',
'obs_secret_key' => 'Jj7Vt1WnU69pWG6QplBmHBkaw6WM4oLU1AZa9Z9n',
'obs_endpoint' => 'obs.cn-east-3.myhuaweicloud.com', // 根据区域修改
'obs_bucket' => 'beevera'
], ],
'obs' => [
'access_key' => 'HPUAWU3GPS8HEWX9JFLG',
'secret_key' => 'Jj7Vt1WnU69pWG6QplBmHBkaw6WM4oLU1AZa9Z9n',
'endpoint' => 'obs.cn-east-3.myhuaweicloud.com', // 根据区域修改
'bucket' => 'beevera'
]
]; ];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment