正在显示
1 个修改的文件
包含
23 行增加
和
23 行删除
| @@ -45,28 +45,28 @@ class TemplateController extends BaseController | @@ -45,28 +45,28 @@ class TemplateController extends BaseController | ||
| 45 | * @author:dc | 45 | * @author:dc |
| 46 | * @time 2023/5/9 15:19 | 46 | * @time 2023/5/9 15:19 |
| 47 | */ | 47 | */ |
| 48 | -// public function info(){ | ||
| 49 | -// // 保存更新 | ||
| 50 | -// if($this->isPost()){ | ||
| 51 | -// $template_id = intval($this->param['template_id']??0); | ||
| 52 | -// // 是否存在模板 | ||
| 53 | -// if($template_id && ATemplate::_bFind($template_id)){ | ||
| 54 | -// BSetting::_save($this->user['project_id'],$template_id); | ||
| 55 | -// }else{ | ||
| 56 | -// return $this->response('无法使用不存在的模板',Code::SYSTEM_ERROR); | ||
| 57 | -// } | ||
| 58 | -// } | ||
| 59 | -// // 读取我的模板 | ||
| 60 | -// $conf = BSetting::_get($this->user['project_id']); | ||
| 61 | -// // 读取模板信息 | ||
| 62 | -// $data = ATemplate::_bFind($conf['template_id']); | ||
| 63 | -// return $this->success([ | ||
| 64 | -// 'template_id' => $data['id']??0, | ||
| 65 | -// 'name' => $data['name']??'', | ||
| 66 | -// 'thumb' => $data['thumb']??'', | ||
| 67 | -// 'time' => $conf['time'] | ||
| 68 | -// ]); | ||
| 69 | -// } | 48 | + public function info(){ |
| 49 | + // 保存更新 | ||
| 50 | + if($this->isPost()){ | ||
| 51 | + $template_id = intval($this->param['template_id']??0); | ||
| 52 | + // 是否存在模板 | ||
| 53 | + if($template_id && ATemplate::_bFind($template_id)){ | ||
| 54 | + BSetting::_save($this->user['project_id'],$template_id); | ||
| 55 | + }else{ | ||
| 56 | + return $this->response('无法使用不存在的模板',Code::SYSTEM_ERROR); | ||
| 57 | + } | ||
| 58 | + } | ||
| 59 | + // 读取我的模板 | ||
| 60 | + $conf = BSetting::_get($this->user['project_id']); | ||
| 61 | + // 读取模板信息 | ||
| 62 | + $data = ATemplate::_bFind($conf['template_id']); | ||
| 63 | + return $this->success([ | ||
| 64 | + 'template_id' => $data['id']??0, | ||
| 65 | + 'name' => $data['name']??'', | ||
| 66 | + 'thumb' => $data['thumb']??'', | ||
| 67 | + 'time' => $conf['time'] | ||
| 68 | + ]); | ||
| 69 | + } | ||
| 70 | 70 | ||
| 71 | /** | 71 | /** |
| 72 | * @remark :使用模版 | 72 | * @remark :使用模版 |
| @@ -75,7 +75,7 @@ class TemplateController extends BaseController | @@ -75,7 +75,7 @@ class TemplateController extends BaseController | ||
| 75 | * @method :post | 75 | * @method :post |
| 76 | * @time :2023/6/27 15:07 | 76 | * @time :2023/6/27 15:07 |
| 77 | */ | 77 | */ |
| 78 | - public function info(TemplateLogic $templateLogic){ | 78 | + public function read(TemplateLogic $templateLogic){ |
| 79 | $this->request->validate([ | 79 | $this->request->validate([ |
| 80 | 'template_id' => 'required', | 80 | 'template_id' => 'required', |
| 81 | ],[ | 81 | ],[ |
-
请 注册 或 登录 后发表评论