|
...
|
...
|
@@ -63,11 +63,14 @@ class CustomTemplateLogic extends BaseLogic |
|
|
|
try {
|
|
|
|
$this->param['url'] = str_replace_url($this->param['url']);
|
|
|
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
$id = $this->editCustomRoute($this->param['id'],$this->param['url']);
|
|
|
|
$id = $this->param['id'];
|
|
|
|
$this->param['url'] = $this->editCustomRoute($this->param['url']);
|
|
|
|
$this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
}else{
|
|
|
|
if($this->param['url'] == $this->model::NOT_FOUND_PAGE_URL){
|
|
|
|
$this->fail('404页面已存在');
|
|
|
|
}else{
|
|
|
|
$this->param['url'] = $this->param['url'].'-tag';
|
|
|
|
}
|
|
|
|
$this->param['project_id'] = $this->user['project_id'];
|
|
|
|
$id = $this->model->addReturnId($this->param);
|
|
...
|
...
|
@@ -166,7 +169,7 @@ class CustomTemplateLogic extends BaseLogic |
|
|
|
* @method :post
|
|
|
|
* @time :2023/9/7 10:02
|
|
|
|
*/
|
|
|
|
public function editCustomRoute($id,$route){
|
|
|
|
public function editCustomRoute($route){
|
|
|
|
$info = $this->model->read(['id'=>$this->param['id']]);
|
|
|
|
if($info['url'] == $this->model::NOT_FOUND_PAGE_URL && $route['url'] != '404'){
|
|
|
|
$this->fail('404页面链接不可修改');
|
|
...
|
...
|
@@ -178,8 +181,12 @@ class CustomTemplateLogic extends BaseLogic |
|
|
|
'route'=>$info['url'],
|
|
|
|
];
|
|
|
|
$this->setRouteDeleteSave($data);
|
|
|
|
//"字符串以\"-product\"结尾"
|
|
|
|
if (!endsWith($route, "-tag")) {
|
|
|
|
$route = $route."-tag";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $id;
|
|
|
|
return $route;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
...
|
...
|
|