正在显示
12 个修改的文件
包含
186 行增加
和
624 行删除
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | -namespace App\Http\Controllers\Bside; | 3 | +namespace App\Http\Controllers\Bside\BCom; |
| 4 | 4 | ||
| 5 | use App\Enums\Common\Code; | 5 | use App\Enums\Common\Code; |
| 6 | -use App\Helper\Translate; | 6 | +use App\Http\Controllers\Bside\BaseController; |
| 7 | use App\Http\Logic\Bside\User\UserLogic; | 7 | use App\Http\Logic\Bside\User\UserLogic; |
| 8 | -use App\Http\Logic\Bside\User\UserLoginLogic; | ||
| 9 | use App\Models\Project\Project; | 8 | use App\Models\Project\Project; |
| 10 | -use App\Models\Project\Project as ProjectModel; | ||
| 11 | -use App\Models\Service\Service; | ||
| 12 | -use App\Models\SmsLog; | ||
| 13 | use App\Models\User\ProjectMenu as ProjectMenuModel; | 9 | use App\Models\User\ProjectMenu as ProjectMenuModel; |
| 14 | use App\Models\User\ProjectRole as ProjectRoleModel; | 10 | use App\Models\User\ProjectRole as ProjectRoleModel; |
| 15 | -use App\Models\User\User; | ||
| 16 | -use App\Models\User\User as UserModel; | ||
| 17 | -use App\Utils\EncryptUtils; | ||
| 18 | -use Illuminate\Http\Request; | ||
| 19 | use Illuminate\Support\Facades\Cache; | 11 | use Illuminate\Support\Facades\Cache; |
| 20 | -use Mrgoon\AliSms\AliSms; | ||
| 21 | 12 | ||
| 22 | /*** | 13 | /*** |
| 23 | - * 当前为公共类 所有方法均不需要验证登录token | 14 | + * 当前为公共类 |
| 24 | */ | 15 | */ |
| 25 | class ComController extends BaseController | 16 | class ComController extends BaseController |
| 26 | { | 17 | { |
| 27 | /** | 18 | /** |
| 28 | - * @name :管理员登录 | ||
| 29 | - * @author :liyuhang | ||
| 30 | - * @method | ||
| 31 | - */ | ||
| 32 | - public function login(){ | ||
| 33 | - $this->request->validate([ | ||
| 34 | - 'mobile'=>['required', 'regex:/^1[3-9]\d{9}$/'], | ||
| 35 | - 'password'=>['required'], | ||
| 36 | - ],[ | ||
| 37 | - 'mobile.required'=>'电话号码必须填写', | ||
| 38 | - 'password.required'=>'内容必须填写', | ||
| 39 | - 'mobile.regex' => '请输入正确的手机号码', | ||
| 40 | - ]); | ||
| 41 | - $userLogic = new UserLoginLogic(); | ||
| 42 | - $res = $userLogic->login(); | ||
| 43 | - $this->response('请求成功',Code::SUCCESS,$res); | ||
| 44 | - } | ||
| 45 | - | ||
| 46 | - /** | ||
| 47 | - * 根据CODE自动登录 | ||
| 48 | - * @author zbj | ||
| 49 | - * @date 2023/7/25 | ||
| 50 | - */ | ||
| 51 | - public function autologin(UserLoginLogic $logic, EncryptUtils $encrypt) | ||
| 52 | - { | ||
| 53 | - $serviceSettingModel = new Service(); | ||
| 54 | - $info = $serviceSettingModel->read(['type'=>4]); | ||
| 55 | - if($info === false){ | ||
| 56 | - $this->response('当前访问地址不存在',Code::USER_ERROR); | ||
| 57 | - } | ||
| 58 | - $data = $encrypt->unlock_url($this->param['code'], $info['values']); | ||
| 59 | - $data = json_decode($data, true); | ||
| 60 | - if(!isset($data['project_id']) && !isset($data['user_id'])){ | ||
| 61 | - $this->response('无效Code',Code::USER_ERROR); | ||
| 62 | - } | ||
| 63 | - $res = $logic->autologin($data); | ||
| 64 | - $this->response('请求成功',Code::SUCCESS, $res); | ||
| 65 | - } | ||
| 66 | - | ||
| 67 | - /** | ||
| 68 | * @name :获取当前用户权限菜单列表 | 19 | * @name :获取当前用户权限菜单列表 |
| 69 | * @author :liyuhang | 20 | * @author :liyuhang |
| 70 | * @method | 21 | * @method |
| @@ -97,7 +48,7 @@ class ComController extends BaseController | @@ -97,7 +48,7 @@ class ComController extends BaseController | ||
| 97 | * @author :liyuhang | 48 | * @author :liyuhang |
| 98 | * @method | 49 | * @method |
| 99 | */ | 50 | */ |
| 100 | - public function get_project(ProjectModel $projectModel){ | 51 | + public function get_project(Project $projectModel){ |
| 101 | $info = $projectModel->read(['id'=>$this->user['project_id']]); | 52 | $info = $projectModel->read(['id'=>$this->user['project_id']]); |
| 102 | if(empty($info)){ | 53 | if(empty($info)){ |
| 103 | $this->response('error',Code::USER_ERROR); | 54 | $this->response('error',Code::USER_ERROR); |
| @@ -125,10 +76,11 @@ class ComController extends BaseController | @@ -125,10 +76,11 @@ class ComController extends BaseController | ||
| 125 | } | 76 | } |
| 126 | 77 | ||
| 127 | /** | 78 | /** |
| 128 | - * @name :退出登录 | ||
| 129 | - * @return void | ||
| 130 | - * @author :liyuhang | 79 | + * @remark :退出登录 |
| 80 | + * @name :logout | ||
| 81 | + * @author :lyh | ||
| 131 | * @method :post | 82 | * @method :post |
| 83 | + * @time :2023/8/19 9:14 | ||
| 132 | */ | 84 | */ |
| 133 | public function logout(){ | 85 | public function logout(){ |
| 134 | $rs = Cache::pull($this->token); | 86 | $rs = Cache::pull($this->token); |
| @@ -138,52 +90,4 @@ class ComController extends BaseController | @@ -138,52 +90,4 @@ class ComController extends BaseController | ||
| 138 | $this->response('success'); | 90 | $this->response('success'); |
| 139 | } | 91 | } |
| 140 | 92 | ||
| 141 | - /** | ||
| 142 | - * 发送登录短信 | ||
| 143 | - * @param Request $request | ||
| 144 | - * @return \Illuminate\Http\JsonResponse | ||
| 145 | - */ | ||
| 146 | - public function sendLoginSms() | ||
| 147 | - { | ||
| 148 | - $this->request->validate([ | ||
| 149 | - 'mobile'=>['required', 'regex:/^1[3-9]\d{9}$/'], | ||
| 150 | - ],[ | ||
| 151 | - 'mobile.required' => '手机号码不能为空', | ||
| 152 | - 'mobile.regex' => '请输入正确的手机号码', | ||
| 153 | - ]); | ||
| 154 | - $mobile = $this->param['mobile']; | ||
| 155 | - $user = UserModel::where(['mobile' => $mobile])->first(); | ||
| 156 | - if (empty($user)) { | ||
| 157 | - $this->response('请输入正确的手机号码!', Code::USER_LOGIN_ERROE); | ||
| 158 | - } | ||
| 159 | - $last_sms = SmsLog::getLastLog($mobile, SmsLog::TYPE_LOGIN); | ||
| 160 | - if ($last_sms && $last_sms->use = SmsLog::USE_USABLE && time() - strtotime($last_sms->created_at) < 60) { | ||
| 161 | - $this->response('请不要重复发送短信!', Code::USER_LOGIN_ERROE); | ||
| 162 | - } | ||
| 163 | - $template = config('aliyunsms.login_sms_temp'); | ||
| 164 | - $code['code'] = rand(100000,999999); | ||
| 165 | - $ali_sms = new AliSms(); | ||
| 166 | - $send = $ali_sms->sendSms(strval($mobile), $template, $code); | ||
| 167 | - if (empty($send->Code) && $send->Code != 'OK') { | ||
| 168 | - $this->response('发送失败, 请稍后重试!', Code::USER_LOGIN_ERROE); | ||
| 169 | - } | ||
| 170 | - SmsLog::createLog($mobile, $code['code']); | ||
| 171 | - $this->response('success'); | ||
| 172 | - } | ||
| 173 | - | ||
| 174 | - /** | ||
| 175 | - * @remark :根据关键字生成链接 | ||
| 176 | - * @name :pubLink | ||
| 177 | - * @author :lyh | ||
| 178 | - * @method :post | ||
| 179 | - * @time :2023/6/28 16:13 | ||
| 180 | - */ | ||
| 181 | - public function stringTranslation(){ | ||
| 182 | - $str = Translate::tran($this->param['str'], 'en'); | ||
| 183 | - $this->response('success',Code::SUCCESS,$str); | ||
| 184 | - } | ||
| 185 | - | ||
| 186 | -// public function ceshi(){ | ||
| 187 | -// | ||
| 188 | -// } | ||
| 189 | } | 93 | } |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :UpdateController.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2023/8/19 9:08 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Controllers\Bside\BCom; | ||
| 11 | + | ||
| 12 | +use App\Http\Controllers\Bside\BaseController; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * @remark :b端网站更新相关 | ||
| 16 | + * @name :UpdateController | ||
| 17 | + * @author :lyh | ||
| 18 | + * @method :post | ||
| 19 | + * @time :2023/8/19 9:08 | ||
| 20 | + */ | ||
| 21 | +class UpdateController extends BaseController | ||
| 22 | +{ | ||
| 23 | + | ||
| 24 | +} |
| 1 | -<?php | ||
| 2 | - | ||
| 3 | - | ||
| 4 | -namespace App\Http\Controllers\Bside; | ||
| 5 | - | ||
| 6 | - | ||
| 7 | -use App\Services\Facades\Upload; | ||
| 8 | -use Illuminate\Http\Request; | ||
| 9 | -use Illuminate\Support\Facades\Storage; | ||
| 10 | - | ||
| 11 | -class FileController extends BaseController | ||
| 12 | -{ | ||
| 13 | - /** | ||
| 14 | - * 上传 | ||
| 15 | - * @param Request $request | ||
| 16 | - * @return \Illuminate\Http\JsonResponse | ||
| 17 | - * @throws \Psr\Container\ContainerExceptionInterface | ||
| 18 | - * @throws \Psr\Container\NotFoundExceptionInterface | ||
| 19 | - * @author zbj | ||
| 20 | - * @date 2023/4/20 | ||
| 21 | - */ | ||
| 22 | - public function upload(Request $request){ | ||
| 23 | - // 上传文件 | ||
| 24 | - $files = Upload::puts('files', $this->param['config'] ?? 'default'); | ||
| 25 | - foreach ($files as &$file){ | ||
| 26 | - $file = Upload::path2url($file); | ||
| 27 | - } | ||
| 28 | - return $this->success($files); | ||
| 29 | - } | ||
| 30 | - | ||
| 31 | - /** | ||
| 32 | - * 下载 | ||
| 33 | - * @param Request $request | ||
| 34 | - * @return \Symfony\Component\HttpFoundation\StreamedResponse | ||
| 35 | - * @author zbj | ||
| 36 | - * @date 2023/4/20 | ||
| 37 | - */ | ||
| 38 | - public function download(Request $request){ | ||
| 39 | - $path = Upload::url2path($this->param['url'] ?? ''); | ||
| 40 | - return Storage::disk('upload')->download($path); | ||
| 41 | - } | ||
| 42 | - | ||
| 43 | - | ||
| 44 | - /** | ||
| 45 | - * 文件列表 | ||
| 46 | - * @author:dc | ||
| 47 | - * @time 2023/5/29 11:42 | ||
| 48 | - */ | ||
| 49 | - public function lists(){ | ||
| 50 | - $type = \request()->get('type'); | ||
| 51 | - | ||
| 52 | - switch ($type){ | ||
| 53 | - case 'video':{ | ||
| 54 | - $ext = ['mp4','avi']; | ||
| 55 | - break; | ||
| 56 | - } | ||
| 57 | - default:{ | ||
| 58 | - $ext = ['png','jpg','jpeg','gif']; | ||
| 59 | - break; | ||
| 60 | - } | ||
| 61 | - } | ||
| 62 | - | ||
| 63 | - $files = Upload::lists($this->param['config'] ?? 'default',$ext); | ||
| 64 | - return $this->success($files); | ||
| 65 | - } | ||
| 66 | - | ||
| 67 | - | ||
| 68 | - | ||
| 69 | -} |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | -namespace App\Http\Controllers\Bside; | 3 | +namespace App\Http\Controllers\Bside\Inquiry; |
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | +use App\Http\Controllers\Bside\BaseController; | ||
| 6 | use App\Http\Logic\Bside\InquiryLogic; | 7 | use App\Http\Logic\Bside\InquiryLogic; |
| 7 | use App\Rules\Ids; | 8 | use App\Rules\Ids; |
| 8 | use App\Services\BatchExportService; | 9 | use App\Services\BatchExportService; |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :LoginController.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2023/8/19 9:11 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Controllers\Bside; | ||
| 11 | + | ||
| 12 | +use App\Enums\Common\Code; | ||
| 13 | +use App\Helper\Translate; | ||
| 14 | +use App\Http\Logic\Bside\User\UserLoginLogic; | ||
| 15 | +use App\Models\Service\Service; | ||
| 16 | +use App\Models\SmsLog; | ||
| 17 | +use App\Models\User\User as UserModel; | ||
| 18 | +use App\Utils\EncryptUtils; | ||
| 19 | +use Illuminate\Support\Facades\Cache; | ||
| 20 | +use Mrgoon\AliSms\AliSms; | ||
| 21 | + | ||
| 22 | +class LoginController extends BaseController | ||
| 23 | +{ | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * @remark :登录 | ||
| 27 | + * @name :login | ||
| 28 | + * @author :lyh | ||
| 29 | + * @method :post | ||
| 30 | + * @time :2023/8/19 9:12 | ||
| 31 | + */ | ||
| 32 | + public function login(){ | ||
| 33 | + $this->request->validate([ | ||
| 34 | + 'mobile'=>['required', 'regex:/^1[3-9]\d{9}$/'], | ||
| 35 | + 'password'=>['required'], | ||
| 36 | + ],[ | ||
| 37 | + 'mobile.required'=>'电话号码必须填写', | ||
| 38 | + 'password.required'=>'内容必须填写', | ||
| 39 | + 'mobile.regex' => '请输入正确的手机号码', | ||
| 40 | + ]); | ||
| 41 | + $userLogic = new UserLoginLogic(); | ||
| 42 | + $res = $userLogic->login(); | ||
| 43 | + $this->response('请求成功',Code::SUCCESS,$res); | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * @remark :自动登录 | ||
| 48 | + * @name :autologin | ||
| 49 | + * @author :lyh | ||
| 50 | + * @method :post | ||
| 51 | + * @time :2023/8/19 9:12 | ||
| 52 | + */ | ||
| 53 | + public function autologin(UserLoginLogic $logic, EncryptUtils $encrypt) | ||
| 54 | + { | ||
| 55 | + $serviceSettingModel = new Service(); | ||
| 56 | + $info = $serviceSettingModel->read(['type'=>4]); | ||
| 57 | + if($info === false){ | ||
| 58 | + $this->response('当前访问地址不存在',Code::USER_ERROR); | ||
| 59 | + } | ||
| 60 | + $data = $encrypt->unlock_url($this->param['code'], $info['values']); | ||
| 61 | + $data = json_decode($data, true); | ||
| 62 | + if(!isset($data['project_id']) && !isset($data['user_id'])){ | ||
| 63 | + $this->response('无效Code',Code::USER_ERROR); | ||
| 64 | + } | ||
| 65 | + $res = $logic->autologin($data); | ||
| 66 | + $this->response('请求成功',Code::SUCCESS, $res); | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + | ||
| 70 | + /** | ||
| 71 | + * @remark :发送验证码 | ||
| 72 | + * @name :sendLoginSms | ||
| 73 | + * @author :lyh | ||
| 74 | + * @method :post | ||
| 75 | + * @time :2023/8/19 9:13 | ||
| 76 | + */ | ||
| 77 | + public function sendLoginSms() | ||
| 78 | + { | ||
| 79 | + $this->request->validate([ | ||
| 80 | + 'mobile'=>['required', 'regex:/^1[3-9]\d{9}$/'], | ||
| 81 | + ],[ | ||
| 82 | + 'mobile.required' => '手机号码不能为空', | ||
| 83 | + 'mobile.regex' => '请输入正确的手机号码', | ||
| 84 | + ]); | ||
| 85 | + $mobile = $this->param['mobile']; | ||
| 86 | + $user = UserModel::where(['mobile' => $mobile])->first(); | ||
| 87 | + if (empty($user)) { | ||
| 88 | + $this->response('请输入正确的手机号码!', Code::USER_LOGIN_ERROE); | ||
| 89 | + } | ||
| 90 | + $last_sms = SmsLog::getLastLog($mobile, SmsLog::TYPE_LOGIN); | ||
| 91 | + if ($last_sms && $last_sms->use = SmsLog::USE_USABLE && time() - strtotime($last_sms->created_at) < 60) { | ||
| 92 | + $this->response('请不要重复发送短信!', Code::USER_LOGIN_ERROE); | ||
| 93 | + } | ||
| 94 | + $template = config('aliyunsms.login_sms_temp'); | ||
| 95 | + $code['code'] = rand(100000,999999); | ||
| 96 | + $ali_sms = new AliSms(); | ||
| 97 | + $send = $ali_sms->sendSms(strval($mobile), $template, $code); | ||
| 98 | + if (empty($send->Code) && $send->Code != 'OK') { | ||
| 99 | + $this->response('发送失败, 请稍后重试!', Code::USER_LOGIN_ERROE); | ||
| 100 | + } | ||
| 101 | + SmsLog::createLog($mobile, $code['code']); | ||
| 102 | + $this->response('success'); | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + /** | ||
| 106 | + * @remark :根据关键字生成链接 | ||
| 107 | + * @name :pubLink | ||
| 108 | + * @author :lyh | ||
| 109 | + * @method :post | ||
| 110 | + * @time :2023/6/28 16:13 | ||
| 111 | + */ | ||
| 112 | + public function stringTranslation(){ | ||
| 113 | + $str = Translate::tran($this->param['str'], 'en'); | ||
| 114 | + $this->response('success',Code::SUCCESS,$str); | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + | ||
| 118 | +} |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | -namespace App\Http\Controllers\Bside; | 3 | +namespace App\Http\Controllers\Bside\Nav; |
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | -use App\Enums\Common\Code; | 6 | +use App\Http\Controllers\Bside\BaseController; |
| 7 | use App\Http\Logic\Bside\Nav\NavLogic; | 7 | use App\Http\Logic\Bside\Nav\NavLogic; |
| 8 | use App\Http\Requests\Bside\Nav\NavRequest; | 8 | use App\Http\Requests\Bside\Nav\NavRequest; |
| 9 | -use App\Models\BNav; | ||
| 10 | 9 | ||
| 11 | /** | 10 | /** |
| 12 | * 导航栏目 b端编辑 c端显示 | 11 | * 导航栏目 b端编辑 c端显示 |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | -namespace App\Http\Controllers\Bside; | 3 | +namespace App\Http\Controllers\Bside\RankData; |
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | use App\Helper\Arr; | 6 | use App\Helper\Arr; |
| 7 | use App\Helper\GoogleSpeedApi; | 7 | use App\Helper\GoogleSpeedApi; |
| 8 | use App\Helper\QuanqiusouApi; | 8 | use App\Helper\QuanqiusouApi; |
| 9 | +use App\Http\Controllers\Bside\BaseController; | ||
| 9 | use App\Http\Logic\Aside\Project\ProjectLogic; | 10 | use App\Http\Logic\Aside\Project\ProjectLogic; |
| 10 | use App\Http\Logic\Bside\RankDataLogic; | 11 | use App\Http\Logic\Bside\RankDataLogic; |
| 11 | use App\Models\RankData\RankData; | 12 | use App\Models\RankData\RankData; |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | -namespace App\Http\Controllers\Bside; | 4 | +namespace App\Http\Controllers\Bside\Route; |
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | -use App\Helper\Translate; | 7 | +use App\Http\Controllers\Bside\BaseController; |
| 8 | use App\Models\RouteMap; | 8 | use App\Models\RouteMap; |
| 9 | -use App\Rules\Ids; | ||
| 10 | use Illuminate\Http\Request; | 9 | use Illuminate\Http\Request; |
| 11 | 10 | ||
| 12 | class RouteController extends BaseController | 11 | class RouteController extends BaseController |
| 1 | -<?php | ||
| 2 | - | ||
| 3 | -namespace App\Http\Controllers\Bside; | ||
| 4 | - | ||
| 5 | - | ||
| 6 | -use App\Http\Logic\Bside\Statistics\StatisticsLogic; | ||
| 7 | -use App\Models\Bside\Statistics\TrafficStatistics; | ||
| 8 | -use Illuminate\Http\JsonResponse; | ||
| 9 | -use Psr\Container\ContainerExceptionInterface; | ||
| 10 | -use Psr\Container\NotFoundExceptionInterface; | ||
| 11 | -use Throwable; | ||
| 12 | - | ||
| 13 | -/** | ||
| 14 | - * 流量统计 | ||
| 15 | - * Class StatisticsController | ||
| 16 | - * @package App\Http\Controllers\Bside | ||
| 17 | - */ | ||
| 18 | -class StatisticsController extends BaseController | ||
| 19 | -{ | ||
| 20 | - public $statisticsLogic; | ||
| 21 | - | ||
| 22 | - public $trafficStatistics; | ||
| 23 | - | ||
| 24 | - public function __construct() | ||
| 25 | - { | ||
| 26 | - $this->statisticsLogic = new StatisticsLogic(); | ||
| 27 | - $this->trafficStatistics = new TrafficStatistics(); | ||
| 28 | - } | ||
| 29 | - | ||
| 30 | - /** | ||
| 31 | - * 访问来源 | ||
| 32 | - * @return JsonResponse | ||
| 33 | - * @throws ContainerExceptionInterface | ||
| 34 | - * @throws NotFoundExceptionInterface|Throwable | ||
| 35 | - */ | ||
| 36 | - public function source() | ||
| 37 | - { | ||
| 38 | - $type = $this->trafficStatistics::TYPE_SOURCE; | ||
| 39 | - $response = $this->statisticsLogic->getStatisticsData($type); | ||
| 40 | - return $this->success($response); | ||
| 41 | - } | ||
| 42 | - | ||
| 43 | - /** | ||
| 44 | - * 地域分布 | ||
| 45 | - * @return JsonResponse | ||
| 46 | - * @throws ContainerExceptionInterface | ||
| 47 | - * @throws NotFoundExceptionInterface|Throwable | ||
| 48 | - */ | ||
| 49 | - public function distribution() | ||
| 50 | - { | ||
| 51 | - $type = $this->trafficStatistics::TYPE_DISTRIBUTION; | ||
| 52 | - $response = $this->statisticsLogic->getStatisticsData($type); | ||
| 53 | - return $this->success($response); | ||
| 54 | - } | ||
| 55 | - | ||
| 56 | - /** | ||
| 57 | - * 受访页面 | ||
| 58 | - * @return JsonResponse | ||
| 59 | - * @throws ContainerExceptionInterface | ||
| 60 | - * @throws NotFoundExceptionInterface|Throwable | ||
| 61 | - */ | ||
| 62 | - public function page() | ||
| 63 | - { | ||
| 64 | - $type = $this->trafficStatistics::TYPE_PAGE; | ||
| 65 | - $response = $this->statisticsLogic->getStatisticsData($type); | ||
| 66 | - return $this->success($response); | ||
| 67 | - } | ||
| 68 | - | ||
| 69 | - /** | ||
| 70 | - * 访问终端 | ||
| 71 | - * @return JsonResponse | ||
| 72 | - * @throws ContainerExceptionInterface | ||
| 73 | - * @throws NotFoundExceptionInterface|Throwable | ||
| 74 | - */ | ||
| 75 | - public function terminal() | ||
| 76 | - { | ||
| 77 | - $type = $this->trafficStatistics::TYPE_TERMINAL; | ||
| 78 | - $response = $this->statisticsLogic->getStatisticsData($type); | ||
| 79 | - return $this->success($response); | ||
| 80 | - } | ||
| 81 | - | ||
| 82 | - /** | ||
| 83 | - * 流量趋势 | ||
| 84 | - * @return JsonResponse | ||
| 85 | - * @throws ContainerExceptionInterface | ||
| 86 | - * @throws NotFoundExceptionInterface|Throwable | ||
| 87 | - */ | ||
| 88 | - public function trend() | ||
| 89 | - { | ||
| 90 | - $type = $this->trafficStatistics::TYPE_TREND; | ||
| 91 | - $response = $this->statisticsLogic->getStatisticsData($type); | ||
| 92 | - $response['days'] = $this->statisticsLogic->getDaysTrend(); | ||
| 93 | - return $this->success($response); | ||
| 94 | - } | ||
| 95 | - | ||
| 96 | - | ||
| 97 | -} |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | -namespace App\Http\Controllers\Bside; | 3 | +namespace App\Http\Controllers\Bside\Visit; |
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | use App\Enums\Common\Code; | 6 | use App\Enums\Common\Code; |
| 7 | +use App\Http\Controllers\Bside\BaseController; | ||
| 7 | use App\Http\Logic\Bside\VisitLogic; | 8 | use App\Http\Logic\Bside\VisitLogic; |
| 8 | -use Illuminate\Http\Request; | ||
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | /** | 11 | /** |
| 1 | -<?php | ||
| 2 | - | ||
| 3 | -namespace App\Http\Logic\Bside\Statistics; | ||
| 4 | - | ||
| 5 | -use App\Http\Logic\Bside\BaseLogic; | ||
| 6 | -use App\Models\Bside\Statistics\TrafficStatistics; | ||
| 7 | -use App\Models\Bside\Statistics\TrafficTrends; | ||
| 8 | -use App\Models\CustomerVisit\CustomerVisit; | ||
| 9 | -use GuzzleHttp\Exception\GuzzleException; | ||
| 10 | -use Illuminate\Contracts\Cache\Repository; | ||
| 11 | -use Illuminate\Database\Eloquent\Builder; | ||
| 12 | -use Illuminate\Database\Eloquent\Collection; | ||
| 13 | -use Illuminate\Support\Facades\DB; | ||
| 14 | -use Psr\Container\ContainerExceptionInterface; | ||
| 15 | -use Psr\Container\NotFoundExceptionInterface; | ||
| 16 | -use Throwable; | ||
| 17 | - | ||
| 18 | -class StatisticsLogic extends BaseLogic | ||
| 19 | -{ | ||
| 20 | - public $trafficStatistics; | ||
| 21 | - | ||
| 22 | - private $customerVisit; | ||
| 23 | - | ||
| 24 | - public $date; | ||
| 25 | - | ||
| 26 | - public $time = 60 * 60 * 2; | ||
| 27 | - | ||
| 28 | - public function __construct() | ||
| 29 | - { | ||
| 30 | - parent::__construct(); | ||
| 31 | - $this->customerVisit = new CustomerVisit(); | ||
| 32 | - $this->trafficStatistics = new TrafficStatistics(); | ||
| 33 | - try { | ||
| 34 | - $this->date = request()->get('date') ?? null; | ||
| 35 | - // 判断传入日期是否大于当月 | ||
| 36 | - if (checkIsGreaterMonth($this->date)) { | ||
| 37 | - $this->date = null; | ||
| 38 | - } | ||
| 39 | - // 判断传入日期是否是当月 | ||
| 40 | - if (checkIsMonth($this->date)) { | ||
| 41 | - $this->date = null; | ||
| 42 | - } | ||
| 43 | - } catch (NotFoundExceptionInterface|ContainerExceptionInterface $e) { | ||
| 44 | - $this->date = null; | ||
| 45 | - } | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | - /** | ||
| 49 | - * @param $type | ||
| 50 | - * @return array|Repository|mixed | ||
| 51 | - * @throws ContainerExceptionInterface | ||
| 52 | - * @throws NotFoundExceptionInterface|Throwable | ||
| 53 | - */ | ||
| 54 | - public function getStatisticsData($type) | ||
| 55 | - { | ||
| 56 | - $function = debug_backtrace()[1]['function']; | ||
| 57 | - // 判断是否查询当月数据 | ||
| 58 | - if (!is_null($this->date)) { | ||
| 59 | - // 获取缓存名 | ||
| 60 | - $key = $this->cacheName($type, $this->date); | ||
| 61 | - $response = cache()->get($key); | ||
| 62 | - if (empty($response)) { | ||
| 63 | - $dd = explode('-', $this->date); | ||
| 64 | - $year = $dd[0] ?? null; | ||
| 65 | - $month = str_pad($dd[1], 2, '0', STR_PAD_LEFT) ?? null; | ||
| 66 | - // 获取当前数据是否存在 | ||
| 67 | - $data = $this->trafficStatistics->getData($type, $year, $month); | ||
| 68 | - if (is_null($data)) { | ||
| 69 | - $response = $this->$function(); | ||
| 70 | - // 存在则直接返回 | ||
| 71 | - $response_data = array_filter($response); | ||
| 72 | - if ($response_data) { | ||
| 73 | - // 不存在则请求接口获取数据并保存 | ||
| 74 | - $this->create($response_data); | ||
| 75 | - } | ||
| 76 | - } else { | ||
| 77 | - $response = $data->toArray(); | ||
| 78 | - } | ||
| 79 | - // 缓存数据 | ||
| 80 | - cache()->put($key, $response, $this->time); | ||
| 81 | - } | ||
| 82 | - } else { | ||
| 83 | - $response = $this->$function(); | ||
| 84 | - } | ||
| 85 | - return $response; | ||
| 86 | - } | ||
| 87 | - | ||
| 88 | - /** | ||
| 89 | - * 获取当月的每天的流量趋势 | ||
| 90 | - * @return Builder[]|Collection | ||
| 91 | - */ | ||
| 92 | - public function getDaysTrend() | ||
| 93 | - { | ||
| 94 | - $trafficTrends = new TrafficTrends(); | ||
| 95 | - $data = $trafficTrends->getMonthsLists($this->date); | ||
| 96 | - $original_date = $data->pluck('date')->all(); | ||
| 97 | - // 获取当月的每天的日期 | ||
| 98 | - $month_date = getDateDays($this->date); | ||
| 99 | - // 判断是否存在缺失的日期 | ||
| 100 | - if (count($month_date) > 1) { | ||
| 101 | - // 去除当天的日期 | ||
| 102 | - array_pop($month_date); | ||
| 103 | - // 获取缺失的日期 | ||
| 104 | - $diff = array_diff($month_date, $original_date); | ||
| 105 | - if ($diff) { | ||
| 106 | - // 获取缺失的数据并保存 | ||
| 107 | - $data = array_merge($data->toArray(), $this->getTrendsLists($diff)); | ||
| 108 | - } | ||
| 109 | - } | ||
| 110 | - $date = date('Y-m-d'); | ||
| 111 | - $ip_count = $this->customerVisit->getDayIPCount(); | ||
| 112 | - $pv_count = $this->customerVisit->getDayPVCount(); | ||
| 113 | - $data[] = compact('date', 'ip_count', 'pv_count'); | ||
| 114 | - return $data; | ||
| 115 | - } | ||
| 116 | - | ||
| 117 | - /** | ||
| 118 | - * 获取缺失的数据并保存 | ||
| 119 | - * @param array $dates 日期,格式:['y-m-d', 'y-m-d'] | ||
| 120 | - * @return array | ||
| 121 | - */ | ||
| 122 | - public function getTrendsLists(array $dates) | ||
| 123 | - { | ||
| 124 | - $data = []; | ||
| 125 | - $trafficTrends = new TrafficTrends(); | ||
| 126 | - foreach ($dates as $item) { | ||
| 127 | - $date = $item; | ||
| 128 | - $ip_count = $this->customerVisit->getDayIPCount($item); | ||
| 129 | - $pv_count = $this->customerVisit->getDayPVCount($item); | ||
| 130 | - $trafficTrends->day = $item; | ||
| 131 | - $trafficTrends->ipnum = $ip_count; | ||
| 132 | - $trafficTrends->pvnum = $pv_count; | ||
| 133 | - $trafficTrends->save(); | ||
| 134 | - $data[] = compact('date', 'ip_count', 'pv_count'); | ||
| 135 | - } | ||
| 136 | - return $data; | ||
| 137 | - } | ||
| 138 | - | ||
| 139 | - /** | ||
| 140 | - * @param $response | ||
| 141 | - * @return bool | ||
| 142 | - * @throws Throwable | ||
| 143 | - */ | ||
| 144 | - public function create($response) | ||
| 145 | - { | ||
| 146 | - DB::beginTransaction(); | ||
| 147 | - $keys = array_flip($this->trafficStatistics::KEY_VALUE); | ||
| 148 | - foreach ($response as $k => $v) { | ||
| 149 | - if (is_array($v)) { | ||
| 150 | - $v = json_encode($v); | ||
| 151 | - } | ||
| 152 | - $field = $keys[$k]; | ||
| 153 | - $this->trafficStatistics->$field = $v; | ||
| 154 | - } | ||
| 155 | - $isRes = $this->trafficStatistics->save(); | ||
| 156 | - if (!$isRes) { | ||
| 157 | - DB::rollBack(); | ||
| 158 | - return false; | ||
| 159 | - } | ||
| 160 | - DB::commit(); | ||
| 161 | - return true; | ||
| 162 | - } | ||
| 163 | - | ||
| 164 | - /** | ||
| 165 | - * 访问来源 | ||
| 166 | - * @return array | ||
| 167 | - */ | ||
| 168 | - public function source() | ||
| 169 | - { | ||
| 170 | - $response = $this->getPvIp(); | ||
| 171 | - $response['lists'] = $this->customerVisit->getUrlCount(); | ||
| 172 | - return $response; | ||
| 173 | - } | ||
| 174 | - | ||
| 175 | - public function getPvIp() | ||
| 176 | - { | ||
| 177 | - $response['pv_count'] = $this->customerVisit->getMonthPVCount(); | ||
| 178 | - $response['ip_count'] = $this->customerVisit->getMonthIPCount(); | ||
| 179 | - return $response; | ||
| 180 | - } | ||
| 181 | - | ||
| 182 | - /** | ||
| 183 | - * 地域分布 | ||
| 184 | - * @return array | ||
| 185 | - */ | ||
| 186 | - public function distribution() | ||
| 187 | - { | ||
| 188 | - $response = $this->getPvIp(); | ||
| 189 | - $response['lists'] = $this->customerVisit->getCountryCount(); | ||
| 190 | - return $response; | ||
| 191 | - } | ||
| 192 | - | ||
| 193 | - /** | ||
| 194 | - * 流量趋势 | ||
| 195 | - * @return array | ||
| 196 | - * @throws ContainerExceptionInterface | ||
| 197 | - * @throws GuzzleException | ||
| 198 | - * @throws NotFoundExceptionInterface | ||
| 199 | - */ | ||
| 200 | - public function trend() | ||
| 201 | - { | ||
| 202 | - $response = $this->getPvIp(); | ||
| 203 | - $inquiry = $this->getCache('inquiry_information', $this->date); | ||
| 204 | - $response['in_count'] = $inquiry['count'] ?? 0; | ||
| 205 | - $response['lists'] = $inquiry['lists'] ?? []; | ||
| 206 | - return $response; | ||
| 207 | - } | ||
| 208 | - | ||
| 209 | - /** | ||
| 210 | - * 访问终端 | ||
| 211 | - * @return array | ||
| 212 | - */ | ||
| 213 | - public function terminal() | ||
| 214 | - { | ||
| 215 | - $response = $this->getPvIp(); | ||
| 216 | - $response['pc_count'] = $this->customerVisit->getTerminalPcCount(); | ||
| 217 | - $response['mobile_count'] = $this->customerVisit->getTerminalMobileCount(); | ||
| 218 | - $response['lists'] = $this->customerVisit->getCountryCount(); | ||
| 219 | - return $response; | ||
| 220 | - } | ||
| 221 | - | ||
| 222 | - /** | ||
| 223 | - * 受访页面 | ||
| 224 | - * @return array | ||
| 225 | - */ | ||
| 226 | - public function page() | ||
| 227 | - { | ||
| 228 | - $response = $this->getPvIp(); | ||
| 229 | - $response['lists'] = $this->customerVisit->getPageCount(); | ||
| 230 | - return $response; | ||
| 231 | - } | ||
| 232 | - | ||
| 233 | - /** | ||
| 234 | - * 获取缓存 | ||
| 235 | - * @param string $key 缓存键名 | ||
| 236 | - * @param string|null $date 日期 格式:Y-m | ||
| 237 | - * @param float|int $time 缓存时间,默认2小时 | ||
| 238 | - * @return mixed | ||
| 239 | - * @throws ContainerExceptionInterface | ||
| 240 | - * @throws GuzzleException | ||
| 241 | - * @throws NotFoundExceptionInterface | ||
| 242 | - */ | ||
| 243 | - public function getCache(string $key, string $date = null, $time = 60 * 60 * 2) | ||
| 244 | - { | ||
| 245 | - $domain = request()->getHttpHost(); //'www.wowstainless.com'; | ||
| 246 | - $sta_date = !is_null($date) ? $date . '-01' : date('Y-m-01'); | ||
| 247 | - $key = $key . '_' . stringUnderlineLowercase($domain) . '_' . str_replace('-', '_', $sta_date); | ||
| 248 | - $value = cache()->get($key); | ||
| 249 | - if (!$value) { | ||
| 250 | - $value = getInquiryInformation($domain, $sta_date); | ||
| 251 | - cache()->put($key, $value, $time); | ||
| 252 | - } | ||
| 253 | - return $value; | ||
| 254 | - } | ||
| 255 | - | ||
| 256 | - /** | ||
| 257 | - * @param int $type | ||
| 258 | - * @param string|null $date 日期 格式:Y-m-d | ||
| 259 | - * @return string | ||
| 260 | - */ | ||
| 261 | - public function cacheName(int $type = TrafficStatistics::TYPE_SOURCE, string $date = null) | ||
| 262 | - { | ||
| 263 | - return 'statistics_' . $type . '_' . str_replace('-', '_', $date); | ||
| 264 | - } | ||
| 265 | - | ||
| 266 | - /** | ||
| 267 | - * 判断传入日期是否是当日 | ||
| 268 | - * @param $date | ||
| 269 | - * @return bool | ||
| 270 | - */ | ||
| 271 | - public function checkIsDay($date) | ||
| 272 | - { | ||
| 273 | - // 传入日期的时间戳 | ||
| 274 | - $timestamp = strtotime($date); | ||
| 275 | - // 当日的日期格式,如:2021-10-13 | ||
| 276 | - $today = date('Y-m-d'); | ||
| 277 | - // 传入日期的日期格式,如:2021-10-12 | ||
| 278 | - $date = date('Y-m-d', $timestamp); | ||
| 279 | - // 判断传入日期是否是当日 | ||
| 280 | - return $date == $today; | ||
| 281 | - } | ||
| 282 | - | ||
| 283 | - /** | ||
| 284 | - * 判断传入日期是否大于当日 | ||
| 285 | - * @param $date | ||
| 286 | - * @return bool | ||
| 287 | - */ | ||
| 288 | - public function checkIsGreaterDay($date) | ||
| 289 | - { | ||
| 290 | - // 传入日期的时间戳 | ||
| 291 | - $timestamp = strtotime($date); | ||
| 292 | - // 当前日期的时间戳 | ||
| 293 | - $now = strtotime(date('Y-m-d')); | ||
| 294 | - // 判断传入日期是否大于当前日期 | ||
| 295 | - return $timestamp > $now; | ||
| 296 | - } | ||
| 297 | -} |
| @@ -8,12 +8,12 @@ use Illuminate\Support\Facades\Route; | @@ -8,12 +8,12 @@ use Illuminate\Support\Facades\Route; | ||
| 8 | //必须登录验证的路由组 | 8 | //必须登录验证的路由组 |
| 9 | Route::middleware(['bloginauth'])->group(function () { | 9 | Route::middleware(['bloginauth'])->group(function () { |
| 10 | //登录用户编辑个人资料 | 10 | //登录用户编辑个人资料 |
| 11 | - Route::any('/edit_info', [\App\Http\Controllers\Bside\ComController::class, 'edit_info'])->name('edit_info'); | ||
| 12 | - Route::any('/logout', [\App\Http\Controllers\Bside\ComController::class, 'logout'])->name('logout'); | 11 | + Route::any('/edit_info', [\App\Http\Controllers\Bside\BCom\ComController::class, 'edit_info'])->name('edit_info'); |
| 12 | + Route::any('/logout', [\App\Http\Controllers\Bside\BCom\ComController::class, 'logout'])->name('logout'); | ||
| 13 | //获取当前登录用户菜单 | 13 | //获取当前登录用户菜单 |
| 14 | - Route::any('/get_menu', [\App\Http\Controllers\Bside\ComController::class, 'get_menu'])->name('get_menu'); | 14 | + Route::any('/get_menu', [\App\Http\Controllers\Bside\BCom\ComController::class, 'get_menu'])->name('get_menu'); |
| 15 | //获取当前登录用户项目详情 | 15 | //获取当前登录用户项目详情 |
| 16 | - Route::any('/get_project', [\App\Http\Controllers\Bside\ComController::class, 'get_project'])->name('get_project'); | 16 | + Route::any('/get_project', [\App\Http\Controllers\Bside\BCom\ComController::class, 'get_project'])->name('get_project'); |
| 17 | //用户相关路由 | 17 | //用户相关路由 |
| 18 | Route::prefix('user')->group(function () { | 18 | Route::prefix('user')->group(function () { |
| 19 | Route::any('/', [\App\Http\Controllers\Bside\User\UserController::class, 'lists'])->name('user_lists'); | 19 | Route::any('/', [\App\Http\Controllers\Bside\User\UserController::class, 'lists'])->name('user_lists'); |
| @@ -210,11 +210,6 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -210,11 +210,6 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 210 | }); | 210 | }); |
| 211 | }); | 211 | }); |
| 212 | 212 | ||
| 213 | - //文件操作 | ||
| 214 | -// Route::prefix('file')->group(function () { | ||
| 215 | -// Route::post('/upload', [\App\Http\Controllers\Bside\FileController::class, 'upload'])->name('file_upload'); | ||
| 216 | -// Route::get('/lists', [\App\Http\Controllers\Bside\FileController::class, 'lists'])->name('file_lists'); | ||
| 217 | -// }); | ||
| 218 | //图片操作 | 213 | //图片操作 |
| 219 | Route::prefix('images')->group(function () { | 214 | Route::prefix('images')->group(function () { |
| 220 | Route::post('/upload', [\App\Http\Controllers\File\ImageController::class, 'upload'])->name('image_upload'); | 215 | Route::post('/upload', [\App\Http\Controllers\File\ImageController::class, 'upload'])->name('image_upload'); |
| @@ -227,15 +222,15 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -227,15 +222,15 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 227 | }); | 222 | }); |
| 228 | //精准询盘 | 223 | //精准询盘 |
| 229 | Route::prefix('inquiry')->group(function () { | 224 | Route::prefix('inquiry')->group(function () { |
| 230 | - Route::get('/', [\App\Http\Controllers\Bside\InquiryController::class, 'index'])->name('inquiry'); | ||
| 231 | - Route::get('/info', [\App\Http\Controllers\Bside\InquiryController::class, 'info'])->name('inquiry_info'); | ||
| 232 | - Route::any('/delete', [\App\Http\Controllers\Bside\InquiryController::class, 'delete'])->name('inquiry_delete'); | ||
| 233 | - Route::any('/export', [\App\Http\Controllers\Bside\InquiryController::class, 'export'])->name('inquiry_export'); | 225 | + Route::get('/', [\App\Http\Controllers\Bside\Inquiry\InquiryController::class, 'index'])->name('inquiry'); |
| 226 | + Route::get('/info', [\App\Http\Controllers\Bside\Inquiry\InquiryController::class, 'info'])->name('inquiry_info'); | ||
| 227 | + Route::any('/delete', [\App\Http\Controllers\Bside\Inquiry\InquiryController::class, 'delete'])->name('inquiry_delete'); | ||
| 228 | + Route::any('/export', [\App\Http\Controllers\Bside\Inquiry\InquiryController::class, 'export'])->name('inquiry_export'); | ||
| 234 | }); | 229 | }); |
| 235 | 230 | ||
| 236 | //生成路由 | 231 | //生成路由 |
| 237 | Route::prefix('route')->group(function () { | 232 | Route::prefix('route')->group(function () { |
| 238 | - Route::any('/create', [\App\Http\Controllers\Bside\RouteController::class, 'create'])->name('create_route'); | 233 | + Route::any('/create', [\App\Http\Controllers\Bside\Route\RouteController::class, 'create'])->name('create_route'); |
| 239 | }); | 234 | }); |
| 240 | 235 | ||
| 241 | //社交绑定 | 236 | //社交绑定 |
| @@ -284,21 +279,21 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -284,21 +279,21 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 284 | }); | 279 | }); |
| 285 | // 导航栏编辑 | 280 | // 导航栏编辑 |
| 286 | Route::prefix('nav')->group(function () { | 281 | Route::prefix('nav')->group(function () { |
| 287 | - Route::get('/', [\App\Http\Controllers\Bside\NavController::class, 'index'])->name('bside_nav'); | ||
| 288 | - Route::post('/create', [\App\Http\Controllers\Bside\NavController::class, 'save'])->name('bside_nav_create'); | ||
| 289 | - Route::post('/update', [\App\Http\Controllers\Bside\NavController::class, 'save'])->name('bside_nav_update'); | ||
| 290 | - Route::delete('/delete', [\App\Http\Controllers\Bside\NavController::class, 'delete'])->name('bside_nav_delete'); | ||
| 291 | - Route::get('/default-urls', [\App\Http\Controllers\Bside\NavController::class, 'urls'])->name('bside_nav_default-urls'); | 282 | + Route::get('/', [\App\Http\Controllers\Bside\Nav\NavController::class, 'index'])->name('bside_nav'); |
| 283 | + Route::post('/create', [\App\Http\Controllers\Bside\Nav\NavController::class, 'save'])->name('bside_nav_create'); | ||
| 284 | + Route::post('/update', [\App\Http\Controllers\Bside\Nav\NavController::class, 'save'])->name('bside_nav_update'); | ||
| 285 | + Route::delete('/delete', [\App\Http\Controllers\Bside\Nav\NavController::class, 'delete'])->name('bside_nav_delete'); | ||
| 286 | + Route::get('/default-urls', [\App\Http\Controllers\Bside\Nav\NavController::class, 'urls'])->name('bside_nav_default-urls'); | ||
| 292 | }); | 287 | }); |
| 293 | 288 | ||
| 294 | //排名数据 | 289 | //排名数据 |
| 295 | Route::prefix('rank_data')->group(function () { | 290 | Route::prefix('rank_data')->group(function () { |
| 296 | - Route::any('/index', [\App\Http\Controllers\Bside\RankDataController::class, 'index'])->name('rank_data'); | ||
| 297 | - Route::any('/keywords_rank_list', [\App\Http\Controllers\Bside\RankDataController::class, 'keywords_rank_list'])->name('rank_data_keywords_rank_list'); | ||
| 298 | - Route::any('/speed', [\App\Http\Controllers\Bside\RankDataController::class, 'speed'])->name('rank_data_speed'); | ||
| 299 | - Route::any('/export', [\App\Http\Controllers\Bside\RankDataController::class, 'export'])->name('rank_data_export'); | ||
| 300 | - Route::any('/export_history', [\App\Http\Controllers\Bside\RankDataController::class, 'export_history'])->name('rank_data_export_history'); | ||
| 301 | - Route::any('/get_google_rank', [\App\Http\Controllers\Bside\RankDataController::class, 'get_google_rank'])->name('rank_data_get_google_rank'); | 291 | + Route::any('/index', [\App\Http\Controllers\Bside\RankData\RankDataController::class, 'index'])->name('rank_data'); |
| 292 | + Route::any('/keywords_rank_list', [\App\Http\Controllers\Bside\RankData\RankDataController::class, 'keywords_rank_list'])->name('rank_data_keywords_rank_list'); | ||
| 293 | + Route::any('/speed', [\App\Http\Controllers\Bside\RankData\RankDataController::class, 'speed'])->name('rank_data_speed'); | ||
| 294 | + Route::any('/export', [\App\Http\Controllers\Bside\RankData\RankDataController::class, 'export'])->name('rank_data_export'); | ||
| 295 | + Route::any('/export_history', [\App\Http\Controllers\Bside\RankData\RankDataController::class, 'export_history'])->name('rank_data_export_history'); | ||
| 296 | + Route::any('/get_google_rank', [\App\Http\Controllers\Bside\RankData\RankDataController::class, 'get_google_rank'])->name('rank_data_get_google_rank'); | ||
| 302 | }); | 297 | }); |
| 303 | 298 | ||
| 304 | //首页统计数据 | 299 | //首页统计数据 |
| @@ -309,8 +304,8 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -309,8 +304,8 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 309 | 304 | ||
| 310 | //访问数据 | 305 | //访问数据 |
| 311 | Route::prefix('visit')->group(function () { | 306 | Route::prefix('visit')->group(function () { |
| 312 | - Route::any('/', [\App\Http\Controllers\Bside\VisitController::class, 'index'])->name('visit_list'); | ||
| 313 | - Route::any('/item', [\App\Http\Controllers\Bside\VisitController::class, 'item'])->name('visit_item'); | 307 | + Route::any('/', [\App\Http\Controllers\Bside\Visit\VisitController::class, 'index'])->name('visit_list'); |
| 308 | + Route::any('/item', [\App\Http\Controllers\Bside\Visit\VisitController::class, 'item'])->name('visit_item'); | ||
| 314 | }); | 309 | }); |
| 315 | 310 | ||
| 316 | //访问数据 | 311 | //访问数据 |
| @@ -320,27 +315,11 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -320,27 +315,11 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 320 | Route::any('/getKeyword', [\App\Http\Controllers\Bside\HomeCount\MonthCountController::class, 'getKeyword'])->name('month_getKeyword'); | 315 | Route::any('/getKeyword', [\App\Http\Controllers\Bside\HomeCount\MonthCountController::class, 'getKeyword'])->name('month_getKeyword'); |
| 321 | }); | 316 | }); |
| 322 | 317 | ||
| 323 | - // 流量统计 | ||
| 324 | - Route::prefix('stat')->group(function () { | ||
| 325 | - // 访问来源 | ||
| 326 | - Route::get('/source', [\App\Http\Controllers\Bside\StatisticsController::class, 'source'])->name('stat_source'); | ||
| 327 | - // 地域分布 | ||
| 328 | - Route::get('/distribution', [\App\Http\Controllers\Bside\StatisticsController::class, 'distribution'])->name('stat_distribution'); | ||
| 329 | - // 受访页面 | ||
| 330 | - Route::get('/page', [\App\Http\Controllers\Bside\StatisticsController::class, 'page'])->name('stat_page'); | ||
| 331 | - // 访问终端 | ||
| 332 | - Route::get('/terminal', [\App\Http\Controllers\Bside\StatisticsController::class, 'terminal'])->name('stat_terminal'); | ||
| 333 | - // 流量趋势 | ||
| 334 | - Route::get('/trend', [\App\Http\Controllers\Bside\StatisticsController::class, 'trend'])->name('stat_trend'); | ||
| 335 | - }); | ||
| 336 | - | ||
| 337 | - | ||
| 338 | }); | 318 | }); |
| 339 | //无需登录验证的路由组 | 319 | //无需登录验证的路由组 |
| 340 | Route::group([], function () { | 320 | Route::group([], function () { |
| 341 | - Route::any('/login', [\App\Http\Controllers\Bside\ComController::class, 'login'])->name('login'); | ||
| 342 | - Route::any('/ceshi', [\App\Http\Controllers\Bside\ComController::class, 'ceshi'])->name('ceshi_ceshi'); | ||
| 343 | - Route::any('/stringTranslation', [\App\Http\Controllers\Bside\ComController::class, 'stringTranslation'])->name('com_stringTranslation'); | ||
| 344 | - Route::any('/sendLoginSms', [\App\Http\Controllers\Bside\ComController::class, 'sendLoginSms'])->name('sendLoginSms'); | ||
| 345 | - Route::any('/autologin', [\App\Http\Controllers\Bside\ComController::class, 'autologin'])->name('autologin'); | 321 | + Route::any('/login', [\App\Http\Controllers\Bside\LoginController::class, 'login'])->name('login'); |
| 322 | + Route::any('/stringTranslation', [\App\Http\Controllers\Bside\LoginController::class, 'stringTranslation'])->name('stringTranslation'); | ||
| 323 | + Route::any('/sendLoginSms', [\App\Http\Controllers\Bside\LoginController::class, 'sendLoginSms'])->name('sendLoginSms'); | ||
| 324 | + Route::any('/autologin', [\App\Http\Controllers\Bside\LoginController::class, 'autologin'])->name('autologin'); | ||
| 346 | }); | 325 | }); |
-
请 注册 或 登录 后发表评论