Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
loveisland
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘小敏
loveisland
Commits
f5a62acc
Commit
f5a62acc
authored
Jun 10, 2026
by
刘小敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
obs临时凭证接口优化
parent
c6761656
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
16 deletions
+12
-16
User.php
addons/shopro/controller/user/User.php
+5
-9
config.php
application/config.php
+7
-7
No files found.
addons/shopro/controller/user/User.php
View file @
f5a62acc
...
@@ -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
());
}
}
}
/**
/**
...
...
application/config.php
View file @
f5a62acc
...
@@ -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'
]
];
];
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment