Commit a6d7be71 authored by 郭勇志's avatar 郭勇志

返回信息修改&文件夹不存在创建

parent 1f82f35d
......@@ -671,7 +671,8 @@ class BranchController extends BaseController
($key+1) => $_branchModel->errors
];
@unlink($fileInfo['INFO'][0]);
throw new HttpException("422", json_encode($returnInfo));
Yii::$app->response->statusCode = 422;
return $returnInfo;
}
}
$transaction->commit();
......
......@@ -49,6 +49,9 @@ class UploadFiles extends Model
$rtn='';
$func = clone (new Func);
if ($this->validate()) {
if(!file_exists(UPLOAD_FILE_PATH)) {
@mkdir(UPLOAD_FILE_PATH, 0777);
}
if (is_array($this->uploadFiles)) {
foreach ($this->uploadFiles as $file) {
$randomName = $func::create_guid();
......
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