作者 lyh

gx

@@ -158,7 +158,7 @@ class FileController @@ -158,7 +158,7 @@ class FileController
158 return $this->response($files->getError(), Code::USER_ERROR); 158 return $this->response($files->getError(), Code::USER_ERROR);
159 } 159 }
160 $data = [ 160 $data = [
161 - 'path' => $url.$fileName, 161 + 'path' => $fileName,
162 'created_at' => date('Y-m-d H:i:s',time()), 162 'created_at' => date('Y-m-d H:i:s',time()),
163 'size' => $res->getSize(), 163 'size' => $res->getSize(),
164 'hash' => $hash, 164 'hash' => $hash,
@@ -200,7 +200,7 @@ class FileController @@ -200,7 +200,7 @@ class FileController
200 return $this->response($file->getError(), Code::USER_ERROR); 200 return $this->response($file->getError(), Code::USER_ERROR);
201 } 201 }
202 $save_data[] = [ 202 $save_data[] = [
203 - 'path' => $url.$fileName, 203 + 'path' => $fileName,
204 'created_at' => date('Y-m-d H:i:s',time()), 204 'created_at' => date('Y-m-d H:i:s',time()),
205 'size' => $res->getSize(), 205 'size' => $res->getSize(),
206 'hash' => $hash, 206 'hash' => $hash,
@@ -38,7 +38,7 @@ class ImageController @@ -38,7 +38,7 @@ class ImageController
38 $this->request = request(); 38 $this->request = request();
39 $this->config = config('filesystems.disks.upload'); 39 $this->config = config('filesystems.disks.upload');
40 $this->uploads = config('upload.default_image'); 40 $this->uploads = config('upload.default_image');
41 - $this->path = $this->uploads['path'].'/'; 41 + $this->path = $this->config['root'].$this->uploads['path'].'/';
42 } 42 }
43 43
44 /** 44 /**
@@ -137,7 +137,7 @@ class ImageController @@ -137,7 +137,7 @@ class ImageController
137 return $this->response($files->getError(), Code::USER_ERROR); 137 return $this->response($files->getError(), Code::USER_ERROR);
138 } 138 }
139 $data = [ 139 $data = [
140 - 'path' => $url.$fileName, 140 + 'path' => $fileName,
141 'created_at' => date('Y-m-d H:i:s',time()), 141 'created_at' => date('Y-m-d H:i:s',time()),
142 'size' => $res->getSize(), 142 'size' => $res->getSize(),
143 'hash' => $hash, 143 'hash' => $hash,
@@ -197,7 +197,7 @@ class ImageController @@ -197,7 +197,7 @@ class ImageController
197 return $this->response($file->getError(), Code::USER_ERROR); 197 return $this->response($file->getError(), Code::USER_ERROR);
198 } 198 }
199 $save_data[] = [ 199 $save_data[] = [
200 - 'path' => $url.$fileName, 200 + 'path' => $fileName,
201 'created_at' => date('Y-m-d H:i:s',time()), 201 'created_at' => date('Y-m-d H:i:s',time()),
202 'updated_at'=>date('Y-m-d H:i:s',time()), 202 'updated_at'=>date('Y-m-d H:i:s',time()),
203 'size' => $res->getSize(), 203 'size' => $res->getSize(),