mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-03 16:24:28 +08:00
优化seo功能,域名跳转和协议跳转;
This commit is contained in:
@@ -4,17 +4,36 @@ namespace app\index\controller;
|
||||
|
||||
use app\BaseController as AppBaseController;
|
||||
use app\common\Bootstrap;
|
||||
use think\exception\HttpResponseException;
|
||||
use think\facade\Request;
|
||||
use think\Paginator;
|
||||
|
||||
class BaseController extends AppBaseController
|
||||
{
|
||||
public function initialize()
|
||||
{
|
||||
parent::initialize();
|
||||
public function initialize()
|
||||
{
|
||||
parent::initialize();
|
||||
|
||||
Paginator::maker(function($items, $listRows, $currentPage, $total, $simple, $options){
|
||||
return new Bootstrap($items, $listRows, $currentPage, $total, $simple, $options);
|
||||
});
|
||||
|
||||
}
|
||||
Paginator::maker(function ($items, $listRows, $currentPage, $total, $simple, $options) {
|
||||
return new Bootstrap($items, $listRows, $currentPage, $total, $simple, $options);
|
||||
});
|
||||
|
||||
$main_domain = get_system_config('main_domain');
|
||||
$url = Request::url();
|
||||
|
||||
if (!empty($main_domain)) {
|
||||
if (Request::host() != $main_domain) {
|
||||
|
||||
throw new HttpResponseException(redirect(Request::scheme() . '://' . $main_domain . '' . $url));
|
||||
}
|
||||
}
|
||||
|
||||
$is_jump_https = get_system_config('is_jump_https', 0);
|
||||
|
||||
if ($is_jump_https == 1) {
|
||||
if (Request::scheme() != 'https') {
|
||||
throw new HttpResponseException(redirect('https://' . $main_domain . '' . $url));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user