正在显示
3 个修改的文件
包含
16 行增加
和
1 行删除
@@ -73,6 +73,18 @@ trait Backend | @@ -73,6 +73,18 @@ trait Backend | ||
73 | { | 73 | { |
74 | if ($this->request->isPost()) { | 74 | if ($this->request->isPost()) { |
75 | $params = $this->request->post("row/a"); | 75 | $params = $this->request->post("row/a"); |
76 | + $host = 'http://feipin.w.brotop.cn'; | ||
77 | + if(isset($params['image']) && !empty($params['image'])){ | ||
78 | + $params['image'] = $host.$params['image']; | ||
79 | + } | ||
80 | + if(isset($params['images']) && !empty($params['images'])){ | ||
81 | + $images = explode(',',$params['images']); | ||
82 | + $img = ''; | ||
83 | + foreach($images as $value){ | ||
84 | + $img .= $host.$value.','; | ||
85 | + } | ||
86 | + $params['images'] = trim($img,','); | ||
87 | + } | ||
76 | if ($params) { | 88 | if ($params) { |
77 | if ($this->dataLimit && $this->dataLimitFieldAutoFill) { | 89 | if ($this->dataLimit && $this->dataLimitFieldAutoFill) { |
78 | $params[$this->dataLimitField] = $this->auth->id; | 90 | $params[$this->dataLimitField] = $this->auth->id; |
@@ -147,13 +147,14 @@ class Person extends Api | @@ -147,13 +147,14 @@ class Person extends Api | ||
147 | $this->error('最多上传9张图片'); | 147 | $this->error('最多上传9张图片'); |
148 | } | 148 | } |
149 | $date = date('Ymd',time()); | 149 | $date = date('Ymd',time()); |
150 | + $host = config('site.hostUrl'); | ||
150 | $images = ''; | 151 | $images = ''; |
151 | foreach($files as $file){ | 152 | foreach($files as $file){ |
152 | //移动到框架应用根目录/public/uploads/ 目录下 | 153 | //移动到框架应用根目录/public/uploads/ 目录下 |
153 | //允许文件大小200k | 154 | //允许文件大小200k |
154 | $info = $file->validate(['size'=>204800,'ext'=>'jpg,png,gif'])->move(ROOT_PATH . 'public' . DS . 'uploads'); | 155 | $info = $file->validate(['size'=>204800,'ext'=>'jpg,png,gif'])->move(ROOT_PATH . 'public' . DS . 'uploads'); |
155 | if($info){ | 156 | if($info){ |
156 | - $images .= '/uploads/'.$date.'/'.$info->getFilename().','; | 157 | + $images .= $host.'/uploads/'.$date.'/'.$info->getFilename().','; |
157 | }else{ | 158 | }else{ |
158 | // 上传失败获取错误信息 | 159 | // 上传失败获取错误信息 |
159 | $this->error($file->getError()); | 160 | $this->error($file->getError()); |
@@ -62,6 +62,8 @@ return array ( | @@ -62,6 +62,8 @@ return array ( | ||
62 | //设置积分规则(分享购买,分享卖废品) | 62 | //设置积分规则(分享购买,分享卖废品) |
63 | 'share_purchase' => 150, | 63 | 'share_purchase' => 150, |
64 | 'share_sell' => 50, | 64 | 'share_sell' => 50, |
65 | + //域名 | ||
66 | + 'hostUrl' => 'http://http://feipin.w.brotop.cn', | ||
65 | //验证规则 | 67 | //验证规则 |
66 | 'user_id' => [ | 68 | 'user_id' => [ |
67 | 'rule' => [ | 69 | 'rule' => [ |
-
请 注册 或 登录 后发表评论