正在显示
1 个修改的文件
包含
28 行增加
和
28 行删除
| @@ -123,7 +123,7 @@ class TemplateController extends BaseController | @@ -123,7 +123,7 @@ class TemplateController extends BaseController | ||
| 123 | $data = TemplateLogic::instance()->first($source,$source_id); | 123 | $data = TemplateLogic::instance()->first($source,$source_id); |
| 124 | 124 | ||
| 125 | 125 | ||
| 126 | - return $this->response('',Code::SUCCESS,$data['html']); | 126 | + return $this->response('',Code::SUCCESS,['html'=>$data['html']]); |
| 127 | 127 | ||
| 128 | } | 128 | } |
| 129 | 129 | ||
| @@ -174,33 +174,33 @@ class TemplateController extends BaseController | @@ -174,33 +174,33 @@ class TemplateController extends BaseController | ||
| 174 | * @time 2023/5/10 14:55 | 174 | * @time 2023/5/10 14:55 |
| 175 | */ | 175 | */ |
| 176 | public function customChunk(){ | 176 | public function customChunk(){ |
| 177 | - | ||
| 178 | - $html = $this->param['html']??[]; | ||
| 179 | - // 那个页面 的 | ||
| 180 | - $type = $this->param['type']??''; | ||
| 181 | - | ||
| 182 | - if(!is_array($html)){ | ||
| 183 | - return $this->response('参数异常',Code::SYSTEM_ERROR); | ||
| 184 | - } | ||
| 185 | - | ||
| 186 | - // 项目id | ||
| 187 | - $project_id = $this->user['project_id']; | ||
| 188 | - // 当前模板 | ||
| 189 | - $template_id = BSetting::_get($project_id)['template_id']; | ||
| 190 | - | ||
| 191 | - // 验证这个模板是否存在 | ||
| 192 | - if(!$type || !ATemplateHtml::_typeExist($template_id,$type)){ | ||
| 193 | - return $this->response('页面类型错误',Code::SYSTEM_ERROR); | ||
| 194 | - } | ||
| 195 | - | ||
| 196 | - | ||
| 197 | - $html = view("template.{$template_id}.{$type}")->render(); | ||
| 198 | - | ||
| 199 | - | ||
| 200 | - return $this->response('',Code::SUCCESS,$html); | ||
| 201 | -// $data = BTemplateData::_insert(); | ||
| 202 | - | ||
| 203 | - | 177 | +// |
| 178 | +// $html = $this->param['html']??[]; | ||
| 179 | +// // 那个页面 的 | ||
| 180 | +// $type = $this->param['type']??''; | ||
| 181 | +// | ||
| 182 | +// if(!is_array($html)){ | ||
| 183 | +// return $this->response('参数异常',Code::SYSTEM_ERROR); | ||
| 184 | +// } | ||
| 185 | +// | ||
| 186 | +// // 项目id | ||
| 187 | +// $project_id = $this->user['project_id']; | ||
| 188 | +// // 当前模板 | ||
| 189 | +// $template_id = BSetting::_get($project_id)['template_id']; | ||
| 190 | +// | ||
| 191 | +// // 验证这个模板是否存在 | ||
| 192 | +// if(!$type || !ATemplateHtml::_typeExist($template_id,$type)){ | ||
| 193 | +// return $this->response('页面类型错误',Code::SYSTEM_ERROR); | ||
| 194 | +// } | ||
| 195 | +// | ||
| 196 | +// | ||
| 197 | +// $html = view("template.{$template_id}.{$type}")->render(); | ||
| 198 | +// | ||
| 199 | +// | ||
| 200 | +// return $this->response('',Code::SUCCESS,$html); | ||
| 201 | +//// $data = BTemplateData::_insert(); | ||
| 202 | +// | ||
| 203 | +// | ||
| 204 | 204 | ||
| 205 | 205 | ||
| 206 | } | 206 | } |
-
请 注册 或 登录 后发表评论