|
...
|
...
|
@@ -51,9 +51,6 @@ class ImageController extends Controller |
|
|
|
$this->request = request();
|
|
|
|
$this->token = $this->request->header('token');
|
|
|
|
$this->cache = Cache::get($this->token);
|
|
|
|
if(!isset($this->token) || empty($this->cache)){
|
|
|
|
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');
|
|
...
|
...
|
@@ -161,7 +158,7 @@ class ImageController extends Controller |
|
|
|
'size' => $res->getSize(),
|
|
|
|
'hash' => $hash,
|
|
|
|
'type'=>$files->getClientOriginalExtension(),
|
|
|
|
'refer'=>$this->param['refer'] ?? '',
|
|
|
|
'refer'=>$this->param['refer'] ?? 0,
|
|
|
|
];
|
|
|
|
$rs = $imageModel->add($data);
|
|
|
|
if ($rs === false) {
|
|
...
|
...
|
@@ -312,13 +309,13 @@ class ImageController extends Controller |
|
|
|
* @time :2023/7/18 15:36
|
|
|
|
*/
|
|
|
|
public function setUrl(){
|
|
|
|
if(!isset($this->param['image_type'])){
|
|
|
|
$this->param['image_type'] = 1;
|
|
|
|
if(!isset($this->param['refer'])){
|
|
|
|
$this->param['refer'] = 1;
|
|
|
|
}
|
|
|
|
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');
|
|
|
|
$this->path = $this->uploads['path_a'].'/'.$this->image_type[$this->param['refer']].'/'.date('Y-m');
|
|
|
|
}else{
|
|
|
|
$this->path = $this->uploads['path_b'].'/'.$this->cache['project_id'].'/'.$this->image_type[$this->param['image_type']].'/'.date('Y-m');
|
|
|
|
$this->path = $this->uploads['path_b'].'/'.$this->cache['project_id'].'/'.$this->image_type[$this->param['refer']].'/'.date('Y-m');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|