Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
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
hujun
tl_estate
Commits
07ce9696
Commit
07ce9696
authored
Jul 04, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
全局图片上传
parent
effe0dde
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
UploadImg.php
application/index/controller/UploadImg.php
+46
-0
No files found.
application/index/controller/UploadImg.php
0 → 100644
View file @
07ce9696
<?php
namespace
app\index\controller
;
use
app\index\extend\Basic
;
use
app\api_broker\service\UploadFileService
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/7/3
* Time : 10:44
* Intro:
*/
class
UploadImg
extends
Basic
{
private
$uFService
;
public
function
__construct
(
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
uFService
=
new
UploadFileService
();
}
/**
* 图片上传
* @return \think\Response
*/
public
function
uploadImg
()
{
header
(
'Access-Control-Allow-Origin:*'
);
set_time_limit
(
0
);
$file
=
$_FILES
[
'image'
];
$type
=
request
()
->
param
(
'type'
);
$uploadResult
=
$this
->
uFService
->
upload
(
$file
,
$type
);
if
(
$uploadResult
[
"code"
]
==
200
)
{
return
$this
->
response
(
"200"
,
"图片上传成功"
,
$uploadResult
[
"msg"
]);
}
else
{
return
$this
->
response
(
"101"
,
$uploadResult
[
"msg"
]);
}
}
}
\ No newline at end of file
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