|
@@ -800,12 +800,14 @@ class User extends BaseController
|
|
|
$filePath = $rootPath. DIRECTORY_SEPARATOR .$hashName;
|
|
$filePath = $rootPath. DIRECTORY_SEPARATOR .$hashName;
|
|
|
$path = dirname($filePath);
|
|
$path = dirname($filePath);
|
|
|
// 检测目录
|
|
// 检测目录
|
|
|
- if (!mkdir($path, 0777, true)) {
|
|
|
|
|
- return ["code"=>-1,"msg"=>"生成目录失败"];
|
|
|
|
|
- }
|
|
|
|
|
if (!is_dir($path)) {
|
|
if (!is_dir($path)) {
|
|
|
|
|
+ if (!mkdir($path, 0777, true)) {
|
|
|
|
|
+ return ["code"=>-1,"msg"=>"生成目录失败"];
|
|
|
|
|
+ }
|
|
|
return ["code"=>-1,"msg"=>"上传目录不存在"];
|
|
return ["code"=>-1,"msg"=>"上传目录不存在"];
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//重名文件验证
|
|
//重名文件验证
|
|
|
if (is_file($filePath)) {
|
|
if (is_file($filePath)) {
|
|
|
return ["code"=>-1,"msg"=>"文件已存在"];
|
|
return ["code"=>-1,"msg"=>"文件已存在"];
|