作者 lyh

gx

@@ -140,6 +140,11 @@ class Handler extends ExceptionHandler @@ -140,6 +140,11 @@ class Handler extends ExceptionHandler
140 'code' => $code, 140 'code' => $code,
141 'message' => $message 141 'message' => $message
142 ]; 142 ];
  143 + // 调试模式
  144 + if(env('app_debug')){
  145 + $response['trace'] = $exception->getTrace();
  146 + }
  147 +
143 //加密返回 148 //加密返回
144 if (config('app.params_encrypt')) { 149 if (config('app.params_encrypt')) {
145 $k = config('app.params_encrypt_key'); 150 $k = config('app.params_encrypt_key');
  1 +<?php
  2 +
  3 +namespace App\Http\Controllers\Aside;
  4 +
  5 +use App\Models\Template\AHeadFoot;
  6 +
  7 +/**
  8 + * 模板
  9 + * @author:dc
  10 + * @time 2023/5/4 17:10
  11 + * Class TemplateController
  12 + * @package App\Http\Controllers\Aside
  13 + */
  14 +class TemplateController extends BaseController
  15 +{
  16 +
  17 +
  18 + /**
  19 + * 列表
  20 + * @author:dc
  21 + * @time 2023/5/4 17:10
  22 + */
  23 + public function index(){
  24 +
  25 + $data = AHeadFoot::all();
  26 + $lists = [];
  27 + // 以名字为单位区分
  28 + foreach ($data as $datum){
  29 + if(empty($lists[$datum['name']])) $lists[$datum['name']] = [];
  30 + $lists[$datum['name']]['name'] = $datum['name'];
  31 + $lists[$datum['name']]['default'] = $datum['is_default'];
  32 + $lists[$datum['name']]['sort'] = $datum['sort'];
  33 + $lists[$datum['name']]['status'] = $datum['status'];
  34 + $lists[$datum['name']]['created_at'] = $datum['created_at'];
  35 +// $lists[$datum['name']]['tags'] = $datum['tags'];
  36 + $lists[$datum['name']][$datum['type']==AHeadFoot::TYPE_HEADER?'header':'footer'] = $datum['html'];
  37 + }
  38 +
  39 + return $this->success($lists);
  40 +
  41 + }
  42 +
  43 +
  44 + /**
  45 + * 编辑
  46 + * @author:dc
  47 + * @time 2023/5/4 16:19
  48 + */
  49 + public function edit(){
  50 +
  51 + }
  52 +
  53 + /**
  54 + * 新增
  55 + * @author:dc
  56 + * @time 2023/5/5 9:30
  57 + */
  58 + public function insert(){
  59 +
  60 + }
  61 +
  62 +
  63 + private function save($name = ''){
  64 +
  65 + }
  66 +
  67 +
  68 + /**
  69 + * 删除
  70 + * @author:dc
  71 + * @time 2023/5/4 17:10
  72 + */
  73 + public function delete(){
  74 +
  75 +
  76 + }
  77 +
  78 +
  79 +
  80 +
  81 +
  82 +}
@@ -35,10 +35,15 @@ class BaseController extends Controller @@ -35,10 +35,15 @@ class BaseController extends Controller
35 $info = Cache::get($this->token); 35 $info = Cache::get($this->token);
36 $this->user = $info; 36 $this->user = $info;
37 $this->uid = $info['id']; 37 $this->uid = $info['id'];
  38 +<<<<<<< HEAD
38 //参数处理 39 //参数处理
39 $this->get_param(); 40 $this->get_param();
40 //日志记录 41 //日志记录
41 $this->set_user_log(); 42 $this->set_user_log();
  43 +=======
  44 + }else{
  45 + throw new HttpResponseException(response(['code'=>Code::USER_ERROR,'msg'=>'当前用户未登录']));
  46 +>>>>>>> db84ec9e0ac005907f6868b371df2ccf8defd114
42 } 47 }
43 } 48 }
44 49
  1 +<?php
  2 +
  3 +namespace App\Http\Controllers\Bside;
  4 +
  5 +
  6 +use App\Enums\Common\Code;
  7 +use App\Models\BNav;
  8 +
  9 +/**
  10 + * 导航栏目 b端编辑 c端显示
  11 + * @author:dc
  12 + * @time 2023/5/8 16:31
  13 + * Class NavController
  14 + * @package App\Http\Controllers\Bside
  15 + */
  16 +class NavController extends BaseController
  17 +{
  18 +
  19 + /**
  20 + * 验证规则
  21 + * @var array[]
  22 + */
  23 + private $verify = [
  24 + 'role' => [
  25 + 'pid' => ['required','integer','gte:0'],
  26 + 'name' => ['required','max:100'],
  27 + 'location' => ['required','in:header,footer'],
  28 + 'url' => ['required','max:200'],
  29 + 'status' => ['required','in:0,1'],
  30 + 'target' => ['required','in:0,1'],
  31 + 'sort' => ['required','integer','gte:0']
  32 + ],
  33 + 'message' => [
  34 + 'pid.required' => '上级选择错误',
  35 + 'pid.gte' => '上级选择错误',
  36 + 'pid.integer' => '上级选择错误',
  37 + 'name.required' => '名称必须',
  38 + 'name.max' => '名称不能超过100个字符',
  39 + 'location.required' => '位置选择错误',
  40 + 'location.in' => '位置选择错误',
  41 + 'url.required' => '链接必须',
  42 + 'url.max' => '链接不能超过200个字符',
  43 + 'status.required' => '状态选择错误',
  44 + 'status.in' => '状态必须是显示/隐藏',
  45 + 'target.required' => '打开方式必须',
  46 + 'target.in' => '打开方式选择错误',
  47 + 'sort.required' => '排序必须',
  48 + 'sort.integer' => '排序必须是一个数字',
  49 + 'sort.gte' => '排序必须大于等于0',
  50 + ],
  51 + 'attr' => [
  52 +
  53 + ]
  54 + ];
  55 +
  56 + /**
  57 + * 列表数据
  58 + * @throws \Psr\Container\ContainerExceptionInterface
  59 + * @throws \Psr\Container\NotFoundExceptionInterface
  60 + * @author:dc
  61 + * @time 2023/5/8 16:37
  62 + */
  63 + public function index(){
  64 +
  65 + $isTree = $this->param['tree']??false;
  66 + // 显示位置
  67 + $location = $this->param['location']??'';
  68 +
  69 + $lists = BNav::_all($this->user['project_id'],$location)->toArray();
  70 +
  71 + if($isTree){
  72 + $lists = list_to_tree($lists);
  73 + }
  74 +
  75 + return $this->success($lists);
  76 +
  77 + }
  78 +
  79 +
  80 +
  81 + /**
  82 + * 创建导航栏
  83 + * @author:dc
  84 + * @time 2023/5/8 16:39
  85 + */
  86 + public function create(){
  87 + return $this->save();
  88 + }
  89 +
  90 +
  91 + /**
  92 + * 修改
  93 + * @return \Illuminate\Http\JsonResponse
  94 + * @throws \Illuminate\Validation\ValidationException
  95 + * @throws \Psr\Container\ContainerExceptionInterface
  96 + * @throws \Psr\Container\NotFoundExceptionInterface
  97 + * @author:dc
  98 + * @time 2023/5/8 17:06
  99 + */
  100 + public function update(){
  101 + $this->verify['role']['id'] = ['required','integer','gt:0'];
  102 + $this->verify['message']['id.gt'] = $this->verify['message']['id.integer'] = $this->verify['message']['id.required'] = '编辑导航数据不存在';
  103 + return $this->save();
  104 + }
  105 +
  106 + /**
  107 + * 新增修改
  108 + * @return \Illuminate\Http\JsonResponse
  109 + * @throws \Illuminate\Validation\ValidationException
  110 + * @throws \Psr\Container\ContainerExceptionInterface
  111 + * @throws \Psr\Container\NotFoundExceptionInterface
  112 + * @author:dc
  113 + * @time 2023/5/8 17:06
  114 + */
  115 + private function save(){
  116 + $data = $this->validate(request() ,$this->verify['role'],$this->verify['message']);
  117 +
  118 + if($data['pid']){
  119 + // 验证是否存在上级
  120 + $all = BNav::_all($this->user['project_id'],$data['location']);
  121 + if(!$all->where('id',$data['pid'])->count()){
  122 + return $this->response('上级栏目不存在','B_NAV_PID_NOTFOUND');
  123 + }
  124 + // 上级不允许是自己的下级
  125 + if(!empty($data['id'])){
  126 + $all = list_to_tree($all->toArray(),$data['id']);
  127 + $all = tree_to_list($all);
  128 + if(in_array($data['pid'],array_column($all,'id'))){
  129 + return $this->response('上级栏目不允许为本身的下级','B_NAV_PID_IS_CHILD');
  130 + }
  131 + }
  132 + }
  133 +
  134 + // 保存
  135 + $id = BNav::_save($this->user['project_id'],$data,$data['id']??0);
  136 +
  137 + if($id===-1){
  138 + return $this->response('导航菜单不存在','B_NAV_NOTFOUND');
  139 + }
  140 +
  141 + return $this->success(BNav::_find($this->user['project_id'],$id,true));
  142 + }
  143 +
  144 +
  145 + /**
  146 + * 删除数据
  147 + * @return \Illuminate\Http\JsonResponse
  148 + * @author:dc
  149 + * @time 2023/5/9 9:20
  150 + */
  151 + public function delete(){
  152 + $id = $this->param['id']??0;
  153 + $data = BNav::_find($this->user['project_id'],$id);
  154 +
  155 + if(empty($data)){
  156 + return $this->response('导航菜单不存在','B_NAV_NOTFOUND');
  157 + }
  158 +
  159 +
  160 + if(BNav::isChild($data['id'],$this->user['project_id'])){
  161 + return $this->response('存在下级无法删除','B_NAV_DELETE_CHILD');
  162 + }
  163 +
  164 +
  165 + if($data->delete()){
  166 + return $this->response('删除成功',Code::SUCCESS);
  167 + }
  168 +
  169 + }
  170 +
  171 +
  172 +
  173 +
  174 +
  175 +
  176 +
  177 +
  178 +}
  1 +<?php
  2 +
  3 +namespace App\Http\Controllers\Bside;
  4 +
  5 +use App\Enums\Common\Code;
  6 +use App\Exceptions\BsideGlobalException;
  7 +use App\Models\Template\AHeadFoot;
  8 +use App\Models\Template\BCustom;
  9 +use App\Models\Template\BHeadFoot;
  10 +use App\Models\Template\BTemplate;
  11 +use Illuminate\Support\Facades\DB;
  12 +
  13 +/**
  14 + * 自定义 页面
  15 + * @author:dc
  16 + * @time 2023/5/4 15:59
  17 + * Class TemplateController
  18 + * @package App\Http\Controllers\Bside
  19 + */
  20 +class TemplateController extends BaseController
  21 +{
  22 +
  23 +
  24 + /**
  25 + * 头部底部的 html
  26 + * @return \Illuminate\Http\JsonResponse
  27 + * @throws \Psr\Container\ContainerExceptionInterface
  28 + * @throws \Psr\Container\NotFoundExceptionInterface
  29 + * @author:dc
  30 + * @time 2023/5/4 16:15
  31 + */
  32 + public function index(){
  33 +
  34 + $data = BTemplate::_get($this->user['project_id']);
  35 +
  36 + // todo::这里要进行html的替换
  37 +
  38 +
  39 +
  40 + return $this->success($data);
  41 + }
  42 +
  43 +
  44 + /**
  45 + * 读取编辑的html
  46 + * @author:dc
  47 + * @time 2023/5/4 16:19
  48 + */
  49 + public function edit_html(){
  50 + $data = BHeadFoot::_get($this->user['project_id']);
  51 +
  52 + if(!$data){
  53 + $data = AHeadFoot::_bDefault();
  54 + }
  55 +
  56 + return $this->success([
  57 + 'header' => $data[BHeadFoot::TYPE_HEADER]??'',
  58 + 'footer' => $data[BHeadFoot::TYPE_FOOTER]??'',
  59 + ]);
  60 + }
  61 +
  62 + /**
  63 + * 保存
  64 + * @author:dc
  65 + * @time 2023/5/4 17:42
  66 + */
  67 + public function edit_save(){
  68 +
  69 + $header = $this->param['header']??'';
  70 +
  71 + $footer = $this->param['footer']??'';
  72 +
  73 + if(!$header && !$footer){
  74 + throw new BsideGlobalException('B01024','不能为空');
  75 + }
  76 +
  77 + DB::beginTransaction();
  78 +
  79 + try {
  80 + if($header){
  81 + BHeadFoot::_save($this->user['project_id'],BHeadFoot::TYPE_HEADER,$header);
  82 + }
  83 +
  84 + if($footer){
  85 + BHeadFoot::_save($this->user['project_id'],BHeadFoot::TYPE_FOOTER,$footer);
  86 + }
  87 + }catch (\Throwable $e){
  88 + DB::rollBack();
  89 +
  90 + throw new BsideGlobalException('B01024','保存失败');
  91 + }
  92 +
  93 + DB::commit();
  94 +
  95 +
  96 + $this->success([]);
  97 +
  98 + }
  99 +
  100 +
  101 + /**
  102 + * 获取系统的模板
  103 + * @author:dc
  104 + * @time 2023/5/4 16:21
  105 + */
  106 + public function system_all_html(){
  107 +
  108 + $data = AHeadFoot::_ball();
  109 +
  110 + $lists = [];
  111 + // 以名字为单位区分
  112 + foreach ($data as $datum){
  113 + if(empty($lists[$datum['name']])) $lists[$datum['name']] = [];
  114 + $lists[$datum['name']]['name'] = $datum['name'];
  115 + $lists[$datum['name']]['default'] = $datum['is_default'];
  116 + $lists[$datum['name']][$datum['type']==AHeadFoot::TYPE_HEADER?'header':'footer'] = $datum['html'];
  117 + }
  118 +
  119 +
  120 + return $this->success(array_values($lists));
  121 +
  122 + }
  123 +
  124 +
  125 +
  126 +
  127 +
  128 +
  129 +
  130 +
  131 + /**
  132 + * 自定义 列表
  133 + * @author:dc
  134 + * @time 2023/5/4 17:13
  135 + */
  136 + public function custom(){
  137 +
  138 + $data = BCustom::_all($this->user['project_id']);
  139 +
  140 +
  141 + return $this->success($data->toArray());
  142 + }
  143 +
  144 +
  145 + public function custom_create(){
  146 +
  147 + }
  148 +
  149 + public function custom_edit($id){
  150 +
  151 + }
  152 +
  153 + public function custom_delete($id){
  154 +
  155 + }
  156 +
  157 +
  158 +
  159 +
  160 +
  161 +
  162 +}
  1 +<?php
  2 +
  3 +namespace App\Models;
  4 +
  5 +use Illuminate\Database\Eloquent\SoftDeletes;
  6 +
  7 +/**
  8 + * b端控制, c端显示的导航
  9 + * @author:dc
  10 + * @time 2023/5/8 16:14
  11 + * Class BNav
  12 + * @package App\Models
  13 + */
  14 +class BNav extends Base
  15 +{
  16 +
  17 + protected $table = 'gl_bside_nav';
  18 +
  19 + use SoftDeletes;
  20 +
  21 + public $hidden = ['deleted_at','project_id'];
  22 +
  23 +
  24 + /**
  25 + * 显示
  26 + */
  27 + const STATUS_ACTIVE = 1;
  28 +
  29 + /**
  30 + * 隐藏
  31 + */
  32 + const STATUS_DISABLED = 0;
  33 +
  34 +
  35 + /**
  36 + * 创建或者新增导航栏
  37 + * @param int $project_id
  38 + * @param array $data
  39 + * @param int $id
  40 + * @return int
  41 + * @author:dc
  42 + * @time 2023/5/8 16:24
  43 + */
  44 + public static function _save(int $project_id, array $data, int $id = 0):int {
  45 + if($id){
  46 + $model = static::where('id',$id)->where('project_id', $project_id)->first();
  47 + if(!$model){
  48 + return -1;
  49 + }
  50 + }else{
  51 + $model = new static();
  52 + $model->project_id = $project_id;
  53 +
  54 + }
  55 +
  56 + $model->pid = $data['pid'];
  57 + $model->name = $data['name'];
  58 + $model->location = $data['location'];
  59 + $model->url = $data['url'];
  60 + $model->status = $data['status'];
  61 + $model->target = $data['target'];
  62 + $model->sort = $data['sort'];
  63 + $model->save();
  64 +
  65 + return $model->id;
  66 + }
  67 +
  68 +
  69 + /**
  70 + * 删除
  71 + * @param int $project_id
  72 + * @param int $id
  73 + * @return mixed
  74 + * @author:dc
  75 + * @time 2023/5/8 16:27
  76 + */
  77 + public static function _del(int $project_id, int $id){
  78 + return static::where(['project_id'=>$project_id,'id'=>$id])->delete();
  79 + }
  80 +
  81 +
  82 + /**
  83 + * 查询当前项目下的所有栏目信息
  84 + * @param int $project_id
  85 + * @return mixed
  86 + * @author:dc
  87 + * @time 2023/5/8 16:29
  88 + */
  89 + public static function _all(int $project_id, string $location = null)
  90 + {
  91 + return static::where(function ($query) use ($project_id,$location){
  92 + // 那个公司
  93 + $query->where('project_id',$project_id);
  94 + // 显示位置
  95 + $location && $query->where('location',$location);
  96 + })
  97 + ->orderBy('sort')
  98 + ->get();
  99 + }
  100 +
  101 + /**
  102 + * 查询一条数据
  103 + * @param int $project_id
  104 + * @param int $id
  105 + * @return mixed
  106 + * @author:dc
  107 + * @time 2023/5/8 17:04
  108 + */
  109 + public static function _find(int $project_id, int $id, $array = false)
  110 + {
  111 + $data = static::where(['id'=>$id,'project_id'=>$project_id])->first();
  112 + if($data){
  113 + return $array ? $data->toArray() : $data;
  114 + }
  115 + return [];
  116 + }
  117 +
  118 +
  119 + /**
  120 + * 是否存在
  121 + * @param int $project_id
  122 + * @param int $id
  123 + * @return mixed
  124 + * @author:dc
  125 + * @time 2023/5/8 17:24
  126 + */
  127 + public static function _check(int $project_id, int $id)
  128 + {
  129 + return static::where(['id'=>$id,'project_id'=>$project_id])->count();
  130 + }
  131 +
  132 + /**
  133 + * 是否有下级
  134 + * @param int $id
  135 + * @param int $project_id
  136 + * @return mixed
  137 + * @author:dc
  138 + * @time 2023/5/9 9:23
  139 + */
  140 + public static function isChild(int $id,int $project_id=0)
  141 + {
  142 + return static::where(['pid'=>$id,'project_id'=>$project_id])->limit(1)->count();
  143 + }
  144 +}
  1 +<?php
  2 +
  3 +namespace App\Models\Template;
  4 +
  5 +/**
  6 + * 头部底部
  7 + * @author:dc
  8 + * @time 2023/5/4 15:52
  9 + * Class AHeadFoot
  10 + * @package App\Models\Template
  11 + */
  12 +class AHeadFoot extends \App\Models\Base{
  13 +
  14 + protected $table = 'gl_aside_template_header_footer';
  15 +
  16 +// 分开存 头底 为了方便后期可能会 改版为 随意搭配 头底部
  17 + const TYPE_HEADER = 'H';
  18 + const TYPE_FOOTER = 'F';
  19 +
  20 + const STATUS_ACTIVE = 1;
  21 + const STATUS_DISABLED = 0;
  22 +
  23 + const IS_DEFAULT = 1;
  24 +
  25 +
  26 + /**
  27 + * b 端 查询
  28 + * @return mixed
  29 + * @author:dc
  30 + * @time 2023/5/4 16:24
  31 + */
  32 + public static function _ball(){
  33 + return static::where('status',static::STATUS_ACTIVE)->orderBy('sort')->get(['id','name','type','html','is_default']);
  34 + }
  35 +
  36 + /**
  37 + * b 端 读取默认的一个头部底部
  38 + * @return mixed
  39 + * @author:dc
  40 + * @time 2023/5/4 16:51
  41 + */
  42 + public static function _bDefault(){
  43 + return static::where(['status'=>static::STATUS_ACTIVE,'is_default'=>static::IS_DEFAULT])
  44 + ->get(['type','html'])
  45 + ->pluck('html','type')
  46 + ->toArray();
  47 + }
  48 +
  49 +
  50 +
  51 +
  52 +}
  1 +<?php
  2 +
  3 +namespace App\Models\Template;
  4 +
  5 +use Illuminate\Database\Eloquent\SoftDeletes;
  6 +
  7 +/**
  8 + * 自定义 页面
  9 + * @author:dc
  10 + * @time 2023/5/4 17:18
  11 + * Class BCustom
  12 + * @package App\Models\Template
  13 + */
  14 +class BCustom extends \App\Models\Base{
  15 +
  16 + protected $table = 'gl_bside_template_custom';
  17 +
  18 + use SoftDeletes;
  19 +
  20 +
  21 + const STATUS_ACTIVE = 1;
  22 +
  23 + const STATUS_DISABLED = 0;
  24 +
  25 +
  26 + /**
  27 + * 读取列表
  28 + * @param $project_id
  29 + * @return mixed
  30 + * @author:dc
  31 + * @time 2023/5/4 17:22
  32 + */
  33 + public static function _all($project_id){
  34 + return static::where([
  35 + 'project_id' => $project_id
  36 + ])->paginate(20);
  37 + }
  38 +
  39 +
  40 +
  41 +
  42 +
  43 +
  44 +}
  1 +<?php
  2 +
  3 +namespace App\Models\Template;
  4 +
  5 +/**
  6 + * 自定义 界面
  7 + * @author:dc
  8 + * @time 2023/5/8 13:52
  9 + * Class BTemplate
  10 + * @package App\Models\Template
  11 + */
  12 +class BTemplate extends \App\Models\Base{
  13 +
  14 + protected $table = 'gl_bside_template_html';
  15 +
  16 +
  17 +
  18 + /**
  19 + * @param $project_id
  20 + * @return mixed
  21 + * @author:dc
  22 + * @time 2023/5/4 16:13
  23 + */
  24 + public static function _get($project_id){
  25 + return static::where(['project_id'=>$project_id])->get(['html','type'])->pluck('html','type')->toArray();
  26 + }
  27 +
  28 +
  29 + public static function _all($project_id){
  30 + return static::where(['project_id'=>$project_id])->get();
  31 + }
  32 +
  33 +
  34 + /**
  35 + * 保存
  36 + * @param $project_id
  37 + * @param $type
  38 + * @param $html
  39 + * @author:dc
  40 + * @time 2023/5/4 17:50
  41 + */
  42 + public static function _save($project_id,$type,$html){
  43 + $data = static::where(['project_id'=>$project_id,'type'=>$type])->first();
  44 + if(!$data){
  45 + $data = new static();
  46 + $data->project_id = $project_id;
  47 + $data->type = $type;
  48 + }
  49 + $data->html = $html;
  50 +
  51 + $data->save();
  52 +
  53 + return $data->id;
  54 + }
  55 +
  56 +
  57 +
  58 +}
@@ -11,7 +11,11 @@ define('LARAVEL_START', microtime(true)); @@ -11,7 +11,11 @@ define('LARAVEL_START', microtime(true));
11 | Composer provides a convenient, automatically generated class loader 11 | Composer provides a convenient, automatically generated class loader
12 | for our application. We just need to utilize it! We'll require it 12 | for our application. We just need to utilize it! We'll require it
13 | into the script here so that we do not have to worry about the 13 | into the script here so that we do not have to worry about the
  14 +<<<<<<< HEAD
14 | loading of any of our classes manually. It's great to relax. 15 | loading of any of our classes manually. It's great to relax.
  16 +=======
  17 +| loading of any our classes "manually". Feels great to relax.
  18 +>>>>>>> db84ec9e0ac005907f6868b371df2ccf8defd114
15 | 19 |
16 */ 20 */
17 21
@@ -124,6 +124,16 @@ Route::middleware(['web'])->group(function (){ //admin用渲染默认要加上w @@ -124,6 +124,16 @@ Route::middleware(['web'])->group(function (){ //admin用渲染默认要加上w
124 }); 124 });
125 }); 125 });
126 126
  127 + // 自定义页面 模板,头部底部
  128 + Route::prefix('template')->group(function () {
  129 + Route::get('/', [\App\Http\Controllers\Aside\TemplateController::class, 'index'])->name('admin.template_header_footer');
  130 + Route::get('/edit', [\App\Http\Controllers\Aside\TemplateController::class, 'edit'])->name('admin.template_header_footer_edit');
  131 + Route::get('/insert', [\App\Http\Controllers\Aside\TemplateController::class, 'insert'])->name('admin.template_header_footer_insert');
  132 + Route::get('/delete', [\App\Http\Controllers\Aside\TemplateController::class, 'delete'])->name('admin.template_header_footer_system');
  133 + });
  134 +
  135 +
  136 +
127 }); 137 });
128 138
129 //无需登录验证的路由组 139 //无需登录验证的路由组
@@ -216,6 +216,30 @@ Route::middleware(['bloginauth'])->group(function () { @@ -216,6 +216,30 @@ Route::middleware(['bloginauth'])->group(function () {
216 Route::any('/del', [\App\Http\Controllers\Bside\AyrShare\AyrShareController::class, 'del_account'])->name('ayr_del_account'); 216 Route::any('/del', [\App\Http\Controllers\Bside\AyrShare\AyrShareController::class, 'del_account'])->name('ayr_del_account');
217 Route::any('/bind', [\App\Http\Controllers\Bside\AyrShare\AyrShareController::class, 'bind_account'])->name('ayr_bind_account'); 217 Route::any('/bind', [\App\Http\Controllers\Bside\AyrShare\AyrShareController::class, 'bind_account'])->name('ayr_bind_account');
218 }); 218 });
  219 +
  220 +
  221 +
  222 +
  223 + // 自定义页面
  224 + Route::prefix('template')->group(function () {
  225 + Route::get('/', [\App\Http\Controllers\Bside\TemplateController::class, 'index'])->name('template_header_footer');
  226 + Route::get('/edit', [\App\Http\Controllers\Bside\TemplateController::class, 'edit_html'])->name('template_header_footer_edit');
  227 + Route::post('/edit', [\App\Http\Controllers\Bside\TemplateController::class, 'edit_save'])->name('template_header_footer_edit_save');
  228 + Route::get('/system', [\App\Http\Controllers\Bside\TemplateController::class, 'system_all_html'])->name('template_header_footer_system');
  229 + Route::get('/custom', [\App\Http\Controllers\Bside\TemplateController::class, 'custom'])->name('template_custom');
  230 + });
  231 +
  232 + // 导航栏编辑
  233 + Route::prefix('nav')->group(function () {
  234 + Route::get('/', [\App\Http\Controllers\Bside\NavController::class, 'index'])->name('bside_nav');
  235 + Route::post('/create', [\App\Http\Controllers\Bside\NavController::class, 'create'])->name('bside_nav_create');
  236 + Route::post('/update', [\App\Http\Controllers\Bside\NavController::class, 'update'])->name('bside_nav_update');
  237 + Route::delete('/delete', [\App\Http\Controllers\Bside\NavController::class, 'delete'])->name('bside_nav_delete');
  238 + });
  239 +
  240 +
  241 +
  242 +
219 }); 243 });
220 244
221 //无需登录验证的路由组 245 //无需登录验证的路由组