作者 lyh

gx

@@ -814,13 +814,6 @@ class ProjectController extends BaseController @@ -814,13 +814,6 @@ class ProjectController extends BaseController
814 * @time :2023/11/17 15:23 814 * @time :2023/11/17 15:23
815 */ 815 */
816 public function saveOtherProject(ProjectLogic $logic){ 816 public function saveOtherProject(ProjectLogic $logic){
817 - $this->request->validate([  
818 - 'project_id'=>'required',  
819 - 'other_project'=>'required|array'  
820 - ],[  
821 - 'project_id.required' => 'project_id不能为空',  
822 - 'other_project.required' => '其他项目设置不能为空',  
823 - ]);  
824 $logic->saveOtherProject(); 817 $logic->saveOtherProject();
825 $this->response('success'); 818 $this->response('success');
826 } 819 }
@@ -696,19 +696,18 @@ class ProjectLogic extends BaseLogic @@ -696,19 +696,18 @@ class ProjectLogic extends BaseLogic
696 } 696 }
697 697
698 /** 698 /**
699 - * @remark :bao 699 + * @remark :保存其他配置
700 * @name :saveOtherProject 700 * @name :saveOtherProject
701 * @author :lyh 701 * @author :lyh
702 * @method :post 702 * @method :post
703 * @time :2023/11/17 15:26 703 * @time :2023/11/17 15:26
704 */ 704 */
705 public function saveOtherProject(){ 705 public function saveOtherProject(){
706 - $buildModel = new DeployBuild();  
707 - $rs = $buildModel->edit(['other_project'=>json_encode($this->param['other_project'])],['project_id'=>$this->param['project_id']]); 706 + $rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
708 if($rs === false){ 707 if($rs === false){
709 $this->fail('系统错误,请联系管理员'); 708 $this->fail('系统错误,请联系管理员');
710 } 709 }
711 - return $this->success(['other_project'=>$this->param['other_project']]); 710 + return $this->success($this->param);
712 } 711 }
713 712
714 } 713 }
@@ -47,7 +47,7 @@ class CustomTemplateLogic extends BaseLogic @@ -47,7 +47,7 @@ class CustomTemplateLogic extends BaseLogic
47 if($info === false){ 47 if($info === false){
48 $this->fail('当前数据不存在'); 48 $this->fail('当前数据不存在');
49 } 49 }
50 - if($info['is_visualization'] == 0){ 50 + if($info['is_visualization'] == 0 || $info['is_visualization'] == 1){
51 $html = $this->getBodyHeaderFooter($info['html'],$info['html_style']); 51 $html = $this->getBodyHeaderFooter($info['html'],$info['html_style']);
52 $info['html'] = $this->getHeadFooter($html); 52 $info['html'] = $this->getHeadFooter($html);
53 } 53 }
@@ -92,15 +92,16 @@ class CustomTemplateLogic extends BaseLogic @@ -92,15 +92,16 @@ class CustomTemplateLogic extends BaseLogic
92 */ 92 */
93 public function saveHtml(){ 93 public function saveHtml(){
94 $html = $this->param['html']; 94 $html = $this->param['html'];
95 - $this->saveCommonTemplate($html);  
96 - $this->param['html'] = characterTruncation($html,'/<main\b[^>]*>(.*?)<\/main>/s');  
97 - $this->param['html_style'] = characterTruncation($html,'/<style id="globalsojs-styles">(.*?)<\/style>/s'); 95 + $info = $this->model->read(['id'=>$this->param['id']],['id','is_visualization','url']);
  96 + if($info['is_visualization'] == 0 || $info['is_visualization'] == 1){//非定制项目+可视化页面
  97 + $this->saveCommonTemplate($html);
  98 + $this->param['html'] = characterTruncation($html,'/<main\b[^>]*>(.*?)<\/main>/s');
  99 + $this->param['html_style'] = characterTruncation($html,'/<style id="globalsojs-styles">(.*?)<\/style>/s');
  100 + }
98 $rs = $this->model->edit($this->param,['id'=>$this->param['id']]); 101 $rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
99 if($rs === false){ 102 if($rs === false){
100 $this->fail('系统错误,请联系管理'); 103 $this->fail('系统错误,请联系管理');
101 } 104 }
102 - //TODO::通知网站更新  
103 - $info = $this->model->read(['id'=>$this->param['id']],['id','url']);  
104 $data = ['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_PAGE, 'route'=>$info['url']]; 105 $data = ['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_PAGE, 'route'=>$info['url']];
105 $this->updateNotify($data); 106 $this->updateNotify($data);
106 return $this->success(); 107 return $this->success();