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
1b0f0b96
Commit
1b0f0b96
authored
Jul 04, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片上传修改
parent
07ce9696
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
UploadFileService.php
application/api_broker/service/UploadFileService.php
+4
-5
route.php
application/route.php
+1
-3
No files found.
application/api_broker/service/UploadFileService.php
View file @
1b0f0b96
...
@@ -74,8 +74,8 @@ class UploadFileService
...
@@ -74,8 +74,8 @@ class UploadFileService
$data
[
'msg'
]
=
"上传图片类型错误"
;
$data
[
'msg'
]
=
"上传图片类型错误"
;
return
$data
;
return
$data
;
}
}
$date
=
date
(
'Ymd'
);
$path
.=
date
(
'Ymd'
)
;
$path
.=
$date
;
$name_str
=
date
(
'YmdHis'
)
.
mt_rand
(
10
,
1000
);
$name_str
=
date
(
'YmdHis'
)
.
mt_rand
(
10
,
1000
);
if
(
is_array
(
$_upload_file
[
'tmp_name'
]))
{
if
(
is_array
(
$_upload_file
[
'tmp_name'
]))
{
...
@@ -86,9 +86,8 @@ class UploadFileService
...
@@ -86,9 +86,8 @@ class UploadFileService
$info
=
$_file
->
validate
(
$valid_date
)
->
move
(
$path
,
$name_str
.
'.'
.
$file_info
[
'extension'
]);
$info
=
$_file
->
validate
(
$valid_date
)
->
move
(
$path
,
$name_str
.
'.'
.
$file_info
[
'extension'
]);
if
(
$info
)
{
if
(
$info
)
{
$data
[
'code'
]
=
200
;
$data
[
'code'
]
=
200
;
$data
[
"msg"
][
$k
][
'img_path'
]
=
$info
->
getSaveName
();
//生成的图片路径
$data
[
"msg"
][
$k
][
'img_path'
]
=
$
date
.
$
info
->
getSaveName
();
//生成的图片路径
$data
[
"msg"
][
$k
][
'img_ext'
]
=
$info
->
getExtension
();
$data
[
"msg"
][
$k
][
'img_ext'
]
=
$info
->
getExtension
();
}
else
{
}
else
{
$data
[
'code'
]
=
101
;
$data
[
'code'
]
=
101
;
...
@@ -103,7 +102,7 @@ class UploadFileService
...
@@ -103,7 +102,7 @@ class UploadFileService
$info
=
$_file
->
validate
(
$valid_date
)
->
move
(
$path
,
$name_str
.
'.'
.
$file_info
[
'extension'
]);
$info
=
$_file
->
validate
(
$valid_date
)
->
move
(
$path
,
$name_str
.
'.'
.
$file_info
[
'extension'
]);
if
(
$info
)
{
if
(
$info
)
{
$data
[
'code'
]
=
200
;
$data
[
'code'
]
=
200
;
$data
[
"msg"
][
'img_path'
]
=
$info
->
getSaveName
();
//生成的图片路径
$data
[
"msg"
][
'img_path'
]
=
$
date
.
$
info
->
getSaveName
();
//生成的图片路径
$data
[
"msg"
][
'img_ext'
]
=
$info
->
getExtension
();
$data
[
"msg"
][
'img_ext'
]
=
$info
->
getExtension
();
}
else
{
}
else
{
$data
[
'code'
]
=
101
;
$data
[
'code'
]
=
101
;
...
...
application/route.php
View file @
1b0f0b96
...
@@ -252,9 +252,7 @@ Route::group('index', [
...
@@ -252,9 +252,7 @@ Route::group('index', [
'getNewsLabel'
=>
[
'index/news/getNewsLabel'
,
[
'method'
=>
'GET'
]
],
//商学院资标签
'getNewsLabel'
=>
[
'index/news/getNewsLabel'
,
[
'method'
=>
'GET'
]
],
//商学院资标签
'delNews'
=>
[
'index/news/delNews'
,
[
'method'
=>
'POST'
]
],
//删除商学院文章
'delNews'
=>
[
'index/news/delNews'
,
[
'method'
=>
'POST'
]
],
//删除商学院文章
'agentEvaluateNumAndFraction'
=>
[
'index/agent/agentEvaluateNumAndFraction'
,
[
'method'
=>
'POST|GET'
]
],
//经纪人列表计算-评价次数和分数 朱伟 2018-07-03
'agentEvaluateNumAndFraction'
=>
[
'index/agent/agentEvaluateNumAndFraction'
,
[
'method'
=>
'POST|GET'
]
],
//经纪人列表计算-评价次数和分数 朱伟 2018-07-03
'uploadImg'
=>
[
'index/UploadImg/uploadImg'
,
[
'method'
=>
'POST'
]
],
//全局图片上传
]);
]);
...
...
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