ソースを参照

fix: 上传远程图片,当前分类有效。

之前完成了上传远程图片,但当前分类无效,必须再次操作移动过来。
joe 4 年 前
コミット
3ba9d411c5

+ 2 - 1
app/admin/controller/widget/Images.php

@@ -153,9 +153,10 @@ class Images extends AuthController
 
     public function window_upload_by_url()
     {
+        $pid = $this->request->param('pid', session('pid'));
         $formbuider = [];
         $formbuider[] = Form::input('url', 'url');
-        $form = Form::make_post_form('输入图片url', $formbuider, Url::buildUrl('upload_by_url'));
+        $form = Form::make_post_form('输入图片url', $formbuider, Url::buildUrl('upload_by_url', ['pid'=>$pid]));
         $this->assign(compact('form'));
         return $this->fetch('public/form-builder');
     }

+ 1 - 1
app/admin/view/widget/images.php

@@ -200,7 +200,7 @@
 
             // 上传远程图片
             uploadImgByUrl: function() {
-                return this.getOpenWindow('远程上传',this.U({a:'window_upload_by_url'}), {w:768, h:300});
+                return this.getOpenWindow('远程上传',this.U({a:'window_upload_by_url'}) +'?pid='+this.pid, {w:768, h:300});
             },
 
             //移动图片分类

+ 1 - 1
public/install/crmeb.sql

@@ -6368,7 +6368,7 @@ CREATE TABLE IF NOT EXISTS `eb_system_attachment` (
   `satt_dir` varchar(200) DEFAULT NULL DEFAULT NULL COMMENT '压缩图片路径',
   `att_size` char(30) NOT NULL DEFAULT '' COMMENT '附件大小',
   `att_type` char(30) NOT NULL DEFAULT '' COMMENT '附件类型',
-  `pid` int(10) NOT NULL DEFAULT 0 COMMENT '分类ID0编辑器,1商品图片,2拼团图片,3砍价图片,4秒杀图片,5文章图片,6组合数据图',
+  `pid` int(10) NOT NULL DEFAULT 0 COMMENT '所属分类ID',
   `time` int(11) NOT NULL DEFAULT 0 COMMENT '上传时间',
   `image_type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '图片上传类型 1本地 2七牛云 3OSS 4COS ',
   `module_type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '图片上传模块类型 1 后台上传 2 用户生成',