upload_type || !isset(Attachment::$uploadTypeExplain[$this->upload_type])) { throw new Exception('上传类型有误'); } $config = Yii::$app->services->attachment->getStorageConfig($this->mall_id); $config['mall_id'] = $this->mall_id; $upload = new UploadHelper($config, $this->upload_type); $upload->verifyFile(); // 添加禁止上传到系统图标目录 if (in_array($this->group_id, array_column(Yii::$app->services->attachment->systemIconGroup, 'id'))) { throw new Exception('禁止上传至系统图标目录'); } $upload->save(); $this->success('上传成功',$upload->getBaseInfo($this->mall_id,$this->mch_id,$this->group_id,$this->store_id,$this->addons_name)); } catch (Exception $e) { $this->error('上传失败:'.$e->getMessage()); } } }