Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
LC_news
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8fb6b447
authored
Dec 17, 2019
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复OSS上传问题
parent
f3c6b6cd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
app/Http/Controllers/ApiController.php
config/website.php
app/Http/Controllers/ApiController.php
View file @
8fb6b447
...
...
@@ -104,8 +104,7 @@ class ApiController extends Controller
$filePath
=
storage_path
()
.
'/app/uploads/'
.
$filename
;
$result
=
json_decode
(
UploadToOss
(
$filePath
),
true
);
Storage
::
disk
(
'uploads'
)
->
delete
(
$filename
);
if
(
!
empty
(
$result
[
'code'
])
&&
$result
[
'code'
]
==
200
&&
!
empty
(
$result
[
'data'
][
0
]))
{
if
(
isset
(
$result
[
'errcode'
])
&&
$result
[
'errcode'
]
==
0
&&
!
empty
(
$result
[
'data'
][
0
]))
{
$this
->
Export
(
0
,
'上传成功'
,
$result
[
'data'
][
0
]);
}
else
return
[
10003
,
'上传失败'
];
...
...
config/website.php
View file @
8fb6b447
...
...
@@ -30,6 +30,6 @@ return [
10000
),
'UploadUrl'
=>
'http://api.
ichunt
.com/oss/upload'
,
//上传图片接口地址
'UploadUrl'
=>
'http://api.
liechuan
.com/oss/upload'
,
//上传图片接口地址
'UploadKey'
=>
'fh6y5t4rr351d2c3bryi'
,
];
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