作者 lyh

gx

@@ -137,13 +137,7 @@ class CustomTemplateLogic extends BaseLogic @@ -137,13 +137,7 @@ class CustomTemplateLogic extends BaseLogic
137 * @time :2023/6/29 16:21 137 * @time :2023/6/29 16:21
138 */ 138 */
139 public function customTemplateSave(){ 139 public function customTemplateSave(){
140 - $this->param['url'] = str_replace_url($this->param['url']);  
141 - if(($this->project['deploy_build']['is_search'] == 0) && ($this->param['url'] == 'search')){  
142 - $this->fail('请先开启搜索页可视化');  
143 - }  
144 - if(($this->project['deploy_build']['is_keyword'] == 0) && ($this->param['url'] == 'keyword')){  
145 - $this->fail('请先开启聚合页可视化');  
146 - } 140 + $this->param = $this->handleSaveParam();;
147 if(isset($this->param['id']) && !empty($this->param['id'])){ 141 if(isset($this->param['id']) && !empty($this->param['id'])){
148 $id = $this->param['id']; 142 $id = $this->param['id'];
149 $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0 143 $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0
@@ -181,6 +175,25 @@ class CustomTemplateLogic extends BaseLogic @@ -181,6 +175,25 @@ class CustomTemplateLogic extends BaseLogic
181 } 175 }
182 176
183 /** 177 /**
  178 + * @remark :参数验证
  179 + * @name :handleSaveParam
  180 + * @author :lyh
  181 + * @method :post
  182 + * @time :2024/8/6 16:52
  183 + */
  184 + public function handleSaveParam(){
  185 + $this->param['url'] = str_replace_url($this->param['url']);
  186 + $this->param['operator_id'] = $this->user['id'];
  187 + if(($this->project['deploy_build']['is_search'] == 0) && ($this->param['url'] == 'search')){
  188 + $this->fail('请先开启搜索页可视化');
  189 + }
  190 + if(($this->project['deploy_build']['is_keyword'] == 0) && ($this->param['url'] == 'keyword')){
  191 + $this->fail('请先开启聚合页可视化');
  192 + }
  193 + return $this->success($this->param);
  194 + }
  195 +
  196 + /**
184 * @remark :可视化保存html 197 * @remark :可视化保存html
185 * @name :saveHtml 198 * @name :saveHtml
186 * @author :lyh 199 * @author :lyh