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