refactor: 进一步区分banner的pc与mobile

This commit is contained in:
2025-05-27 14:02:14 +08:00
parent b30ec56bec
commit d43892b912
5 changed files with 47 additions and 9 deletions

View File

@@ -0,0 +1,25 @@
<?php
declare (strict_types = 1);
namespace app\index\middleware;
class ConfirmRequestFrom
{
/**
* 处理请求
*
* @param \think\Request $request
* @param \Closure $next
* @return Response
*/
public function handle($request, \Closure $next)
{
// 确认请求来源
$request->from = 'pc';
if ($request->isMobile()) {
$request->from = 'mobile';
}
return $next($request);
}
}