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,6 +4,8 @@ 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
|
||||
@@ -16,5 +18,22 @@ class BaseController extends AppBaseController
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<fieldset class="layui-elem-field">
|
||||
<legend>系统管理</legend>
|
||||
<div class="layui-field-box">
|
||||
<form class="layui-form" action="{:url('admin/System/update')}" method="post">
|
||||
<form class="layui-form" action="{:url('admin/System/update')}" method="post" lay-filter="*">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-form-label">网站名称</div>
|
||||
<div class="layui-input-block">
|
||||
@@ -163,6 +163,13 @@
|
||||
class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-form-label">自动跳转https</div>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="is_jump_https" value="1" title="开启">
|
||||
<input type="radio" name="is_jump_https" value="0" title="关闭">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-form-label">资源域名</div>
|
||||
<div class="layui-input-block">
|
||||
@@ -214,9 +221,14 @@
|
||||
{include file="common/_footer"}
|
||||
|
||||
<script>
|
||||
layui.use(['layer', 'upload'], function () {
|
||||
layui.use(['layer', 'upload','form'], function () {
|
||||
var upload = layui.upload;
|
||||
|
||||
var form = layui.form;
|
||||
|
||||
form.val('*',{
|
||||
'is_jump_https':'{:get_system_config("is_jump_https",0)}'
|
||||
})
|
||||
|
||||
var uploadSiteLogo = upload.render({
|
||||
elem: '.upload-site-logo',
|
||||
|
||||
Reference in New Issue
Block a user