新增数据加密秘钥设置、cookie有效域名设置

feat/task1-c-wallet
gongfuxiang 2022-06-29 15:01:00 +08:00
parent c7b1ec0780
commit 8b5b004e37
6 changed files with 35 additions and 5 deletions

View File

@ -43,7 +43,7 @@
<option value="{{$v.id}}" {{if isset($data['admin_login_info_bg_images_rand']['value']) and $data['admin_login_info_bg_images_rand']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
{{/foreach}}
</select>
<div class="am-alert am-alert-warning" data-am-alert>
<div class="am-alert am-alert-warning">
<p>1. 默认背景图片位于[ public/static/admin/default/images/login ]目录下</p>
<p>2. 变更图片后、需要在[ app/admin/controller/Admin.php ]文件中[ LoginInfo ]方法中修改[ bg_images_list ]变量</p>
</div>
@ -98,13 +98,38 @@
<div class="am-form-group">
<label>{{$data.common_baidu_map_ak.name}}<span class="am-form-group-label-tips">{{$data.common_baidu_map_ak.describe}}</span></label>
<input type="text" name="{{$data.common_baidu_map_ak.only_tag}}" placeholder="{{$data.common_baidu_map_ak.describe}}" data-validation-message="{{$data.common_baidu_map_ak.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_baidu_map_ak.value}}"{{/if}} />
<div class="am-alert am-alert-warning" data-am-alert>
<div class="am-alert am-alert-warning">
请到百度地图开放平台申请 {{if !empty($site_store_links) and !empty($site_store_links['baidu_map_course'])}}<a href="{{$site_store_links.baidu_map_course}}" target="_blank" class="am-margin-left-sm">查看配置教程 <i class="am-icon-external-link"></i></a>{{/if}}
</div>
</div>
</div>
</div>
<!-- 安全 -->
<div class="am-panel am-panel-default">
<div class="am-panel-hd">
<h3 class="am-panel-title">安全</h3>
</div>
<div class="am-panel-bd am-padding-vertical-xs">
<div class="am-form-group">
<label>{{$data.common_data_encryption_secret.name}}<span class="am-form-group-label-tips">{{$data.common_data_encryption_secret.describe}}</span></label>
<input type="text" name="{{$data.common_data_encryption_secret.only_tag}}" placeholder="{{$data.common_data_encryption_secret.describe}}" data-validation-message="{{$data.common_data_encryption_secret.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_data_encryption_secret.value}}"{{/if}} />
<div class="am-alert am-alert-warning">
<p>一些常用的数据加解密使用、比如用户登录信息加密临时存储</p>
</div>
</div>
<div class="am-form-group">
<label>{{$data.common_cookie_domain.name}}<span class="am-form-group-label-tips">{{$data.common_cookie_domain.describe}}</span></label>
<input type="text" name="{{$data.common_cookie_domain.only_tag}}" placeholder="{{$data.common_cookie_domain.describe}}" data-validation-message="{{$data.common_cookie_domain.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_cookie_domain.value}}"{{/if}} />
<div class="am-alert am-alert-warning">
<p>1. 默认空、则仅对当前访问域名有效</p>
<p>2. 如需要二级域名也共享cookie则填写顶级域名、如baidu.com</p>
</div>
</div>
</div>
</div>
<div class="am-form-group am-form-group-refreshing am-margin-top-lg am-padding-left-0">
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
</div>

View File

@ -116,6 +116,7 @@
<button type="button" class="am-close">&times;</button>
<p>2. 站点域名未设置则使用当前站点域名域名地址[ <a href="{{$my_domain}}" target="_blank">{{$my_domain}}</a> ]</p>
<p>2. 附件和静态地址未设置则使用当前站点静态域名地址[ <a href="{{$my_public_url}}" target="_blank">{{$my_public_url}}</a> ]</p>
<p>3. 如服务器端不是以public设为根目录的、则这里配置【附件cdn域名、css/js静态文件cdn域名】需要后面再加public、如{{$my_public_url}}public/</p>
<div class="am-text-danger am-margin-top-xs">
<p>在命令行模式下运行项目,该区域地址必须配置、否则项目中一些地址会缺失域名信息。</p>
<p>请勿乱配置、错误地址会导致网站无法访问地址配置以http开头</p>

View File

@ -2559,8 +2559,7 @@ function Authcode($string, $operation = 'DECODE', $key = '', $expiry = 0)
$ckey_length = 4;
// 密匙
// $GLOBALS['discuz_auth_key'] 这里可以根据自己的需要修改
$key = md5($key ? $key : 'shopxo');
$key = md5(empty($key) ? MyC('common_data_encryption_secret', 'shopxo', true) : $key);
// 密匙a会参与加解密
$keya = md5(substr($key, 0, 16));

View File

@ -110,6 +110,9 @@ class ConfigService
// 是否采用https连接商店
'common_is_https_connect_store',
// cookie有效域名
'common_cookie_domain',
];
/**

View File

@ -18,7 +18,7 @@ return [
// cookie 保存路径
'path' => '/',
// cookie 有效域名
'domain' => __MY_MAIN_DOMAIN__,
'domain' => MyFileConfig('common_cookie_domain', '', '', true),
// cookie 启用安全传输
'secure' => false,
// httponly设置

View File

@ -48,6 +48,7 @@ form.am-form .am-form-group-refreshing, .plug-file-upload-view { border-bottom:
.chosen-container { width: 100% !important; }
.am-tagsinput { display: block; padding: 3px 5px; border-radius: 2px; min-height: 30px; }
.chosen-choices, .chosen-single { border-radius: 2px; }
.chosen-choices li { overflow: hidden; }
.chosen-choices li.search-field input[type="text"] { height: 29px !important; }
.chosen-choices li.search-field input[type="text"]:hover,
.am-tagsinput input[type="text"]:hover { box-shadow: 0 0 0 #fff !important; border: 0 !important; }
@ -61,6 +62,7 @@ form.am-form .am-form-group-refreshing, .plug-file-upload-view { border-bottom:
.chosen-disabled .chosen-choices, .chosen-disabled .chosen-single { background-color: #ccc; }
.chosen-disabled .search-choice { background: #d6d6d6 !important; }
.chosen-container-multi .chosen-choices li.search-choice {margin: 4px 4px 4px 0;}
.chosen-container-multi .chosen-choices li.search-choice .search-choice-close { top: 0; right: 0; padding: 2px; background: #f4f4f4; width: auto; height: auto;}
/**
*