正在显示
8 个修改的文件
包含
120 行增加
和
12 行删除
| @@ -29,15 +29,9 @@ class BaseController extends Controller | @@ -29,15 +29,9 @@ class BaseController extends Controller | ||
| 29 | { | 29 | { |
| 30 | $this->request = $request; | 30 | $this->request = $request; |
| 31 | $this->param = $this->request->all(); | 31 | $this->param = $this->request->all(); |
| 32 | - $this->token = $this->request->header('token'); | ||
| 33 | - if(!empty($this->token) && !empty(Cache::get($this->token))){ | ||
| 34 | - $info = Cache::get($this->token); | ||
| 35 | - $this->user = $info; | ||
| 36 | - $this->uid = $info['id']; | ||
| 37 | - //参数处理 | ||
| 38 | - $this->get_param(); | ||
| 39 | - } | ||
| 40 | - | 32 | + $this->user = Session::get('manage'); |
| 33 | + $this->uid = $this->user['id']; | ||
| 34 | + $this->get_param(); | ||
| 41 | } | 35 | } |
| 42 | 36 | ||
| 43 | 37 |
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Http\Controllers\Aside\Project; | ||
| 4 | + | ||
| 5 | +use App\Enums\Common\Code; | ||
| 6 | +use App\Http\Controllers\Aside\BaseController; | ||
| 7 | +use App\Http\Logic\Aside\Project\GscLogic; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * @remark :优化gsc账号 | ||
| 11 | + * @name :ProjectGscController | ||
| 12 | + * @author :lyh | ||
| 13 | + * @time :2023/6/19 11:25 | ||
| 14 | + */ | ||
| 15 | +class ProjectGscController extends BaseController | ||
| 16 | +{ | ||
| 17 | + | ||
| 18 | + /** | ||
| 19 | + * @remark :gsc账号列表 | ||
| 20 | + * @name :lists | ||
| 21 | + * @author :lyh | ||
| 22 | + * @method :post | ||
| 23 | + * @time :2023/6/19 11:25 | ||
| 24 | + */ | ||
| 25 | + public function lists(GscLogic $gscLogic){ | ||
| 26 | + $this->request->validate([ | ||
| 27 | + 'project_id'=>'required' | ||
| 28 | + ],[ | ||
| 29 | + 'project_id.required' => '项目ID不能为空' | ||
| 30 | + ]); | ||
| 31 | + $lists = $gscLogic->GscLists($this->map,$this->page,$this->row,$this->order); | ||
| 32 | + $this->response('success',Code::SUCCESS,$lists); | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + /** | ||
| 36 | + * @remark :根据gsc账号获取域名 | ||
| 37 | + * @name :lists | ||
| 38 | + * @author :lyh | ||
| 39 | + * @method :post | ||
| 40 | + * @time :2023/6/19 10:48 | ||
| 41 | + */ | ||
| 42 | + public function domainLists(GscLogic $gscLogic){ | ||
| 43 | + $this->request->validate([ | ||
| 44 | + 'gsc_id'=>'required' | ||
| 45 | + ],[ | ||
| 46 | + 'gsc_id.required' => 'GSC账号ID不能为空' | ||
| 47 | + ]); | ||
| 48 | + $lists = $gscLogic->DomainLists($this->map,$this->page,$this->row,$this->order); | ||
| 49 | + $this->response('success',Code::SUCCESS,$lists); | ||
| 50 | + } | ||
| 51 | +} |
app/Http/Logic/Aside/Project/GscLogic.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Http\Logic\Aside\Project; | ||
| 4 | + | ||
| 5 | +use App\Http\Logic\Aside\BaseLogic; | ||
| 6 | +use App\Models\Project\DomainInfo; | ||
| 7 | +use App\Models\Project\Gsc; | ||
| 8 | + | ||
| 9 | +class GscLogic extends BaseLogic | ||
| 10 | +{ | ||
| 11 | + public function __construct() | ||
| 12 | + { | ||
| 13 | + parent::__construct(); | ||
| 14 | + $this->model = new Gsc(); | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * @remark :gsc账号列表 | ||
| 19 | + * @name :GscLists | ||
| 20 | + * @author :lyh | ||
| 21 | + * @method :post | ||
| 22 | + * @time :2023/6/19 11:32 | ||
| 23 | + */ | ||
| 24 | + public function GscLists($map,$page,$row,$order = 'created_at',$files = ['*']){ | ||
| 25 | + $lists = $this->model->lists($map,$page,$row,$order,$files); | ||
| 26 | + return $this->success($lists); | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * @remark :gsc账号列表 | ||
| 31 | + * @name :DomainLists | ||
| 32 | + * @author :lyh | ||
| 33 | + * @method :post | ||
| 34 | + * @time :2023/6/19 15:56 | ||
| 35 | + */ | ||
| 36 | + public function DomainLists($map,$page,$row,$order = 'created_at',$files = ['*']){ | ||
| 37 | + $domainModel = new DomainInfo(); | ||
| 38 | + $lists = $domainModel->lists($map,$page,$row,$order,$files); | ||
| 39 | + return $this->success($lists); | ||
| 40 | + } | ||
| 41 | +} |
| @@ -7,7 +7,7 @@ use App\Models\Base; | @@ -7,7 +7,7 @@ use App\Models\Base; | ||
| 7 | /** | 7 | /** |
| 8 | * Class DomainInfo | 8 | * Class DomainInfo |
| 9 | * | 9 | * |
| 10 | - * @package App\Models\Aside\Domain | 10 | + * @package App\Models\Aside\DomainLogic |
| 11 | * @Author YiYuan-LIn | 11 | * @Author YiYuan-LIn |
| 12 | * @Date : 2019/5/16 | 12 | * @Date : 2019/5/16 |
| 13 | * 域名信息模型 | 13 | * 域名信息模型 |
| @@ -5,7 +5,7 @@ namespace App\Models\Aside\Domain; | @@ -5,7 +5,7 @@ namespace App\Models\Aside\Domain; | ||
| 5 | use Illuminate\Database\Eloquent\Model; | 5 | use Illuminate\Database\Eloquent\Model; |
| 6 | 6 | ||
| 7 | /** | 7 | /** |
| 8 | - * App\Models\Aside\Domain\DomainInfoLog | 8 | + * App\Models\Aside\DomainLogic\DomainInfoLog |
| 9 | * | 9 | * |
| 10 | * @property int $id | 10 | * @property int $id |
| 11 | * @property int|null $user_id 操作用户 | 11 | * @property int|null $user_id 操作用户 |
app/Models/Project/Gsc.php
0 → 100644
| @@ -146,7 +146,7 @@ return [ | @@ -146,7 +146,7 @@ return [ | ||
| 146 | 146 | ||
| 147 | /* | 147 | /* |
| 148 | |-------------------------------------------------------------------------- | 148 | |-------------------------------------------------------------------------- |
| 149 | - | Session Cookie Domain | 149 | + | Session Cookie DomainLogic |
| 150 | |-------------------------------------------------------------------------- | 150 | |-------------------------------------------------------------------------- |
| 151 | | | 151 | | |
| 152 | | Here you may change the domain of the cookie used to identify a session | 152 | | Here you may change the domain of the cookie used to identify a session |
| @@ -169,6 +169,12 @@ Route::middleware(['web','accesstoken'])->group(function (){ //adminç”¨æ¸²æŸ“é» | @@ -169,6 +169,12 @@ Route::middleware(['web','accesstoken'])->group(function (){ //adminç”¨æ¸²æŸ“é» | ||
| 169 | Route::post('/chunk/update', [\App\Http\Controllers\Aside\TemplateController::class, 'chunk_save'])->name('admin.template.chunk_update'); | 169 | Route::post('/chunk/update', [\App\Http\Controllers\Aside\TemplateController::class, 'chunk_save'])->name('admin.template.chunk_update'); |
| 170 | Route::delete('/chunk/delete/{chunk_id}', [\App\Http\Controllers\Aside\TemplateController::class, 'chunk_delete'])->where('chunk_id','\d+')->name('admin.template.chunk_delete'); | 170 | Route::delete('/chunk/delete/{chunk_id}', [\App\Http\Controllers\Aside\TemplateController::class, 'chunk_delete'])->where('chunk_id','\d+')->name('admin.template.chunk_delete'); |
| 171 | }); | 171 | }); |
| 172 | + | ||
| 173 | + //优化gsc账号记录表 | ||
| 174 | + Route::prefix('gsc')->group(function () { | ||
| 175 | + Route::any('/', [Aside\Project\ProjectGscController::class, 'lists'])->name('admin.lists'); | ||
| 176 | + Route::any('/read', [Aside\Project\ProjectGscController::class, 'domainLists'])->name('admin.domainLists'); | ||
| 177 | + }); | ||
| 172 | }); | 178 | }); |
| 173 | 179 | ||
| 174 | //无需登录验证的路由组 | 180 | //无需登录验证的路由组 |
-
请 注册 或 登录 后发表评论