|
@@ -58,25 +58,16 @@ class CustomTemplateLogic extends BaseLogic |
|
@@ -58,25 +58,16 @@ class CustomTemplateLogic extends BaseLogic |
|
58
|
*/
|
58
|
*/
|
|
59
|
public function customTemplateSave(){
|
59
|
public function customTemplateSave(){
|
|
60
|
try {
|
60
|
try {
|
|
|
|
61
|
+ $this->param['url'] = str_replace_url($this->param['url']);
|
|
61
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
62
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
62
|
- if(isset($this->param['html']) && !empty($this->param['html'])){
|
|
|
|
63
|
- $html = $this->param['html'];
|
|
|
|
64
|
- $this->param['html'] = characterTruncation($html,'/<main>(.*?)<\/main>/s');
|
|
|
|
65
|
- $this->param['html_style'] = characterTruncation($html,'/<style id="globalsojs-styles">(.*?)<\/style>/s');
|
|
|
|
66
|
- }
|
|
|
|
67
|
- //查看路由是否更新
|
|
|
|
68
|
- if(isset($this->param['url']) && !empty($this->param['url'])){
|
|
|
|
69
|
- $this->param['url'] = str_replace_url($this->param['url']);
|
|
|
|
70
|
- $id = $this->editCustomRoute($this->param['id'],$this->param['url']);
|
|
|
|
71
|
- $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $id, $this->user['project_id']);
|
|
|
|
72
|
- }
|
63
|
+ $id = $this->editCustomRoute($this->param['id'],$this->param['url']);
|
|
73
|
$this->model->edit($this->param,['id'=>$this->param['id']]);
|
64
|
$this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
74
|
}else{
|
65
|
}else{
|
|
75
|
$this->param['project_id'] = $this->user['project_id'];
|
66
|
$this->param['project_id'] = $this->user['project_id'];
|
|
76
|
$id = $this->model->addReturnId($this->param);
|
67
|
$id = $this->model->addReturnId($this->param);
|
|
77
|
- $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $id, $this->user['project_id']);
|
|
|
|
78
|
- $this->model->edit(['url'=>$route],['id'=>$route]);
|
|
|
|
79
|
}
|
68
|
}
|
|
|
|
69
|
+ $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $id, $this->user['project_id']);
|
|
|
|
70
|
+ $this->model->edit(['url'=>$route],['id'=>$route]);
|
|
80
|
}catch (\Exception $e){
|
71
|
}catch (\Exception $e){
|
|
81
|
$this->fail('error');
|
72
|
$this->fail('error');
|
|
82
|
}
|
73
|
}
|
|
@@ -87,6 +78,20 @@ class CustomTemplateLogic extends BaseLogic |
|
@@ -87,6 +78,20 @@ class CustomTemplateLogic extends BaseLogic |
|
87
|
}
|
78
|
}
|
|
88
|
|
79
|
|
|
89
|
/**
|
80
|
/**
|
|
|
|
81
|
+ * @remark :可视化保存html
|
|
|
|
82
|
+ * @name :saveHtml
|
|
|
|
83
|
+ * @author :lyh
|
|
|
|
84
|
+ * @method :post
|
|
|
|
85
|
+ * @time :2023/9/16 17:13
|
|
|
|
86
|
+ */
|
|
|
|
87
|
+ public function saveHtml(){
|
|
|
|
88
|
+ $html = $this->param['html'];
|
|
|
|
89
|
+ $this->param['html'] = characterTruncation($html,'/<main>(.*?)<\/main>/s');
|
|
|
|
90
|
+ $this->param['html_style'] = characterTruncation($html,'/<style id="globalsojs-styles">(.*?)<\/style>/s');
|
|
|
|
91
|
+ $this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
92
|
+ }
|
|
|
|
93
|
+
|
|
|
|
94
|
+ /**
|
|
90
|
* @remark :查看路由是否更新
|
95
|
* @remark :查看路由是否更新
|
|
91
|
* @name :editProduct
|
96
|
* @name :editProduct
|
|
92
|
* @author :lyh
|
97
|
* @author :lyh
|