Commit 1b0f0b96 authored by hujun's avatar hujun

图片上传修改

parent 07ce9696
......@@ -74,8 +74,8 @@ class UploadFileService
$data['msg'] = "上传图片类型错误";
return $data;
}
$path .= date('Ymd');
$date = date('Ymd');
$path .= $date;
$name_str = date('YmdHis') . mt_rand(10,1000);
if (is_array($_upload_file['tmp_name'])) {
......@@ -86,9 +86,8 @@ class UploadFileService
$info = $_file->validate($valid_date)->move($path, $name_str . '.' . $file_info['extension']);
if ($info) {
$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();
} else {
$data['code'] = 101;
......@@ -103,7 +102,7 @@ class UploadFileService
$info = $_file->validate($valid_date)->move($path, $name_str . '.' . $file_info['extension']);
if ($info) {
$data['code'] = 200;
$data["msg"]['img_path'] = $info->getSaveName(); //生成的图片路径
$data["msg"]['img_path'] = $date . $info->getSaveName(); //生成的图片路径
$data["msg"]['img_ext'] = $info->getExtension();
} else {
$data['code'] = 101;
......
......@@ -252,9 +252,7 @@ Route::group('index', [
'getNewsLabel' => [ 'index/news/getNewsLabel', [ 'method' => 'GET' ] ], //商学院资标签
'delNews' => [ 'index/news/delNews', [ 'method' => 'POST' ] ], //删除商学院文章
'agentEvaluateNumAndFraction' => [ 'index/agent/agentEvaluateNumAndFraction', [ 'method' => 'POST|GET' ] ],//经纪人列表计算-评价次数和分数 朱伟 2018-07-03
'uploadImg' => [ 'index/UploadImg/uploadImg', [ 'method' => 'POST' ] ],//全局图片上传
]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment