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
7425af1c
Commit
7425af1c
authored
Jun 11, 2026
by
刘小敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传文件设置公共读权限;obs插件状态开;
parent
bf77467c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
37 deletions
+64
-37
Index.php
addons/hwobs/controller/Index.php
+5
-1
info.ini
addons/hwobs/info.ini
+1
-1
addons.php
application/extra/addons.php
+56
-33
upload.php
application/extra/upload.php
+2
-2
spark.js
public/assets/addons/hwobs/js/spark.js
+0
-0
addons.js
public/assets/js/addons.js
+0
-0
No files found.
addons/hwobs/controller/Index.php
View file @
7425af1c
...
...
@@ -70,6 +70,7 @@ class Index extends Controller
$ret
=
$obs
->
initiateMultipartUpload
([
'Bucket'
=>
$config
[
'bucket'
],
'Key'
=>
$key
,
'ACL'
=>
'public-read'
,
// 设置公共读权限
]);
}
catch
(
\Exception
$e
)
{
$this
->
error
(
"上传失败"
);
...
...
@@ -84,12 +85,14 @@ class Index extends Controller
'Bucket'
=>
$config
[
'bucket'
],
'Key'
=>
$key
,
'FormParams'
=>
[
'acl'
=>
'public-read'
// 设置公共读权限
]
]);
$params
[
'key'
]
=
$key
;
$params
[
'AccessKeyId'
]
=
$config
[
'accessKey'
];
$params
[
'policy'
]
=
$signature
[
'Policy'
];
$params
[
'signature'
]
=
$signature
[
'Signature'
];
$params
[
'acl'
]
=
'public-read'
;
// 传递 ACL 参数给前端
}
$params
[
'headers'
]
=
$headers
;
$params
[
'date'
]
=
$date
;
...
...
@@ -237,7 +240,8 @@ class Index extends Controller
$ret
=
$obs
->
putObject
([
'Bucket'
=>
$config
[
'bucket'
],
'Key'
=>
ltrim
(
$attachment
->
url
,
'/'
),
'SourceFile'
=>
$filePath
'SourceFile'
=>
$filePath
,
'ACL'
=>
'public-read'
,
// 设置公共读权限
]);
//成功不做任何操作
}
catch
(
\Exception
$e
)
{
...
...
addons/hwobs/info.ini
View file @
7425af1c
...
...
@@ -4,7 +4,7 @@ intro = 使用华为OBS作为默认云储存
author
=
FastAdmin
website
=
version = 1.2.10
state
=
0
state
=
1
url
=
/addons/hwobs
license
=
regular
licenseto
=
114257
application/extra/addons.php
View file @
7425af1c
<?php
return
[
'autoload'
=>
false
,
'hooks'
=>
[
'epay_config_init'
=>
[
'epay'
,
],
'addon_action_begin'
=>
[
'epay'
,
],
'action_begin'
=>
[
'epay'
,
],
'upgrade'
=>
[
'shopro'
,
'simditor'
,
],
'app_init'
=>
[
'shopro'
,
],
'config_init'
=>
[
'shopro'
,
'simditor'
,
],
],
'route'
=>
[
'/example$'
=>
'example/index/index'
,
'/example/d/[:name]'
=>
'example/demo/index'
,
'/example/d1/[:name]'
=>
'example/demo/demo1'
,
'/example/d2/[:name]'
=>
'example/demo/demo2'
,
],
'priority'
=>
[],
'domain'
=>
''
,
];
return
array
(
'autoload'
=>
false
,
'hooks'
=>
array
(
'epay_config_init'
=>
array
(
0
=>
'epay'
,
),
'addon_action_begin'
=>
array
(
0
=>
'epay'
,
),
'action_begin'
=>
array
(
0
=>
'epay'
,
),
'module_init'
=>
array
(
0
=>
'hwobs'
,
),
'upload_config_init'
=>
array
(
0
=>
'hwobs'
,
),
'upload_delete'
=>
array
(
0
=>
'hwobs'
,
),
'app_init'
=>
array
(
0
=>
'hwobs'
,
1
=>
'shopro'
,
),
'upgrade'
=>
array
(
0
=>
'shopro'
,
1
=>
'simditor'
,
),
'config_init'
=>
array
(
0
=>
'shopro'
,
1
=>
'simditor'
,
),
),
'route'
=>
array
(
'/example$'
=>
'example/index/index'
,
'/example/d/[:name]'
=>
'example/demo/index'
,
'/example/d1/[:name]'
=>
'example/demo/demo1'
,
'/example/d2/[:name]'
=>
'example/demo/demo2'
,
),
'priority'
=>
array
(
),
'domain'
=>
''
,
);
application/extra/upload.php
View file @
7425af1c
...
...
@@ -7,9 +7,9 @@ return [
*/
'uploadurl'
=>
'ajax/upload'
,
/**
* CDN地址
* CDN地址
(华为云OBS域名)
*/
'cdnurl'
=>
''
,
'cdnurl'
=>
'
https://beevera.obs.cn-east-3.myhuaweicloud.com
'
,
/**
* 文件保存格式
*/
...
...
addons/hwobs/asset
s/js/spark.js
→
public/assets/addons/hwob
s/js/spark.js
View file @
7425af1c
File moved
public/assets/js/addons.js
View file @
7425af1c
This diff is collapsed.
Click to expand it.
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