|
@@ -35,6 +35,7 @@ class ImageController extends Controller |
|
@@ -35,6 +35,7 @@ class ImageController extends Controller |
|
35
|
public $map = [];
|
35
|
public $map = [];
|
|
36
|
|
36
|
|
|
37
|
|
37
|
|
|
|
|
38
|
+
|
|
38
|
public $upload_location = 1;//是否同步到cos
|
39
|
public $upload_location = 1;//是否同步到cos
|
|
39
|
//上传图片类型
|
40
|
//上传图片类型
|
|
40
|
public $image_type = [
|
41
|
public $image_type = [
|
|
@@ -53,6 +54,9 @@ class ImageController extends Controller |
|
@@ -53,6 +54,9 @@ class ImageController extends Controller |
|
53
|
$this->config = config('filesystems.disks.upload');
|
54
|
$this->config = config('filesystems.disks.upload');
|
|
54
|
$this->uploads = config('upload.default_image');
|
55
|
$this->uploads = config('upload.default_image');
|
|
55
|
$this->get_param();
|
56
|
$this->get_param();
|
|
|
|
57
|
+ //获取当前登录用户详情
|
|
|
|
58
|
+ $this->token = $this->request->header('token');
|
|
|
|
59
|
+ $this->cache = Cache::get($this->token);
|
|
56
|
}
|
60
|
}
|
|
57
|
|
61
|
|
|
58
|
/**
|
62
|
/**
|
|
@@ -345,6 +349,9 @@ class ImageController extends Controller |
|
@@ -345,6 +349,9 @@ class ImageController extends Controller |
|
345
|
* @time :2023/6/29 11:48
|
349
|
* @time :2023/6/29 11:48
|
|
346
|
*/
|
350
|
*/
|
|
347
|
public function getImageList(){
|
351
|
public function getImageList(){
|
|
|
|
352
|
+ if(isset($this->cache['project_id']) && !empty($this->cache['project_id'])){
|
|
|
|
353
|
+ $this->map['project_id'] = $this->cache['project_id'];
|
|
|
|
354
|
+ }
|
|
348
|
$imageModel = new ImageModel();
|
355
|
$imageModel = new ImageModel();
|
|
349
|
$lists = $imageModel->lists($this->map,$this->page,$this->row);
|
356
|
$lists = $imageModel->lists($this->map,$this->page,$this->row);
|
|
350
|
if(!empty($lists) && !empty($lists['list'])){
|
357
|
if(!empty($lists) && !empty($lists['list'])){
|
|
@@ -368,9 +375,6 @@ class ImageController extends Controller |
|
@@ -368,9 +375,6 @@ class ImageController extends Controller |
|
368
|
if(isset($this->param['refer_type']) && $this->param['refer_type'] == 1){
|
375
|
if(isset($this->param['refer_type']) && $this->param['refer_type'] == 1){
|
|
369
|
$this->path = $this->uploads['path_a'].'/'.$this->image_type[$this->param['refer']].'/'.date('Y-m');
|
376
|
$this->path = $this->uploads['path_a'].'/'.$this->image_type[$this->param['refer']].'/'.date('Y-m');
|
|
370
|
}else{
|
377
|
}else{
|
|
371
|
- //B端上传
|
|
|
|
372
|
- $this->token = $this->request->header('token');
|
|
|
|
373
|
- $this->cache = Cache::get($this->token);
|
|
|
|
374
|
if(!isset($this->param['upload_method'])){
|
378
|
if(!isset($this->param['upload_method'])){
|
|
375
|
//根据项目上传标识区分上传到cos/本地
|
379
|
//根据项目上传标识区分上传到cos/本地
|
|
376
|
$projectModel = new Project();
|
380
|
$projectModel = new Project();
|