作者 lyh

gx

@@ -52,14 +52,14 @@ class ImageController extends Controller @@ -52,14 +52,14 @@ class ImageController extends Controller
52 $this->token = $this->request->header('token'); 52 $this->token = $this->request->header('token');
53 $this->cache = Cache::get($this->token); 53 $this->cache = Cache::get($this->token);
54 if(!isset($this->token) || empty($this->cache)){ 54 if(!isset($this->token) || empty($this->cache)){
55 - $this->response('请登录后上传',Code::USER_LOGIN_ERROE); 55 + return response(['code'=>Code::USER_LOGIN_ERROE,'msg'=>'当前用户未登录']);
56 } 56 }
57 $this->param = $this->request->all(); 57 $this->param = $this->request->all();
58 $this->config = config('filesystems.disks.upload'); 58 $this->config = config('filesystems.disks.upload');
59 $this->uploads = config('upload.default_image'); 59 $this->uploads = config('upload.default_image');
60 //上传路径设置 60 //上传路径设置
61 if(!isset($this->param['image_type'])){ 61 if(!isset($this->param['image_type'])){
62 - $this->response('类型不能为空',Code::USER_ERROR); 62 + return response(['code'=>Code::USER_ERROR,'msg'=>'请设置类型']);
63 } 63 }
64 if(isset($this->param['refer_type']) && $this->param['refer_type'] == 1){ 64 if(isset($this->param['refer_type']) && $this->param['refer_type'] == 1){
65 $this->path = $this->uploads['path_a'].'/'.$this->image_type[$this->param['image_type']].'/'.date('Y-m'); 65 $this->path = $this->uploads['path_a'].'/'.$this->image_type[$this->param['image_type']].'/'.date('Y-m');