登录提交信息加密,新增Base64的支持
This commit is contained in:
@@ -25,6 +25,9 @@ public class DesUtils {
|
||||
if (StringUtils.isBlank(data)){
|
||||
return "";
|
||||
}
|
||||
if ("Base64".equals(secretKey)) {
|
||||
return EncodeUtils.encodeBase64(data);
|
||||
}
|
||||
String[] ks = StringUtils.split(secretKey, ",");
|
||||
if (ks.length >= 3){
|
||||
return desCore.strEnc(data, ks[0], ks[1], ks[2]);
|
||||
@@ -39,6 +42,9 @@ public class DesUtils {
|
||||
if (StringUtils.isBlank(data)){
|
||||
return "";
|
||||
}
|
||||
if ("Base64".equals(secretKey)) {
|
||||
return EncodeUtils.decodeBase64String(data);
|
||||
}
|
||||
String[] ks = StringUtils.split(secretKey, ",");
|
||||
if (ks.length >= 3){
|
||||
return desCore.strDec(data, ks[0], ks[1], ks[2]);
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
*/
|
||||
this.DesUtils.encode = function(data, secretKey){
|
||||
if (data && secretKey){
|
||||
if (secretKey === 'Base64'){
|
||||
return Base64.encode(data);
|
||||
}
|
||||
var ks = secretKey.split(',');
|
||||
if (ks.length >= 3){
|
||||
return strEnc(data, ks[0], ks[1], ks[2]);
|
||||
@@ -32,6 +35,9 @@
|
||||
*/
|
||||
this.DesUtils.decode = function(data, secretKey){
|
||||
if (data && secretKey){
|
||||
if (secretKey === 'Base64'){
|
||||
return Base64.decode(data);
|
||||
}
|
||||
var ks = secretKey.split(',');
|
||||
if (ks.length >= 3){
|
||||
return strDec(data, ks[0], ks[1], ks[2]);
|
||||
|
||||
@@ -325,8 +325,9 @@ shiro:
|
||||
|
||||
# 登录提交信息加密(如果不需要加密,设置为空即可)
|
||||
loginSubmit:
|
||||
# 登录提交信息安全Key,加密用户名、密码、验证码,后再提交(key设置为3个,用逗号分隔)默认加密方式:DES
|
||||
secretKey: thinkgem,jeesite,com
|
||||
# 登录提交信息安全Key,加密用户名、密码、验证码,后再提交(key设置为3个,用逗号分隔)默认加密方式:DES、Base64
|
||||
# secretKey: thinkgem,jeesite,com
|
||||
secretKey: Base64
|
||||
|
||||
# 记住我密钥设置,为空则自动生成一个新密钥,也可以通过 com.jeesite.test.RememberMeKeyGen 生成
|
||||
rememberMe:
|
||||
|
||||
@@ -76,11 +76,11 @@
|
||||
</div>
|
||||
<div class="login-copyright">
|
||||
© ${@DateUtils.getYear()} ${@Global.getConfig('productName')} - Powered By <a
|
||||
href="http://jeesite.com">JeeSite ${@Global.getProperty('jeesiteVersion')}</a>
|
||||
id="loginKey" data-key="${@Global.getConfig('shiro.loginSubmit.secretKey')}"
|
||||
href="http://jeesite.com" >JeeSite ${@Global.getProperty('jeesiteVersion')}</a>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
<script>var secretKey = '${@Global.getConfig("shiro.loginSubmit.secretKey")}';</script>
|
||||
<script src="${ctxStatic}/jquery-toastr/2.1/toastr.min.js?${_version}"></script>
|
||||
<script src="${ctxStatic}/common/des.js?${_version}"></script>
|
||||
<script src="${ctxStatic}/jquery-toastr/2.1/toastr.min.js?${_version}"></script>
|
||||
<script src="${ctxStatic}/modules/sys/sysLogin.js?${_version}"></script>
|
||||
@@ -20,7 +20,7 @@ demoMode: false
|
||||
|
||||
server:
|
||||
|
||||
port: 8980
|
||||
port: 8981
|
||||
servlet:
|
||||
context-path: /js
|
||||
tomcat:
|
||||
@@ -39,7 +39,7 @@ jdbc:
|
||||
# Mysql 数据库配置
|
||||
type: mysql
|
||||
driver: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/jeesite?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&serverTimezone=UTC
|
||||
url: jdbc:mysql://127.0.0.1:3306/jeesite?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=UTC
|
||||
username: root
|
||||
password: 123456
|
||||
testSql: SELECT 1
|
||||
@@ -130,9 +130,9 @@ jdbc:
|
||||
# minIdle: 3
|
||||
# maxActive: 20
|
||||
|
||||
# # JTA 分布式事务,建议启用多数据源的时候开启(v4.0.4+)
|
||||
# jta:
|
||||
# enabled: false
|
||||
# JTA 分布式事务,建议启用多数据源的时候开启(v4.0.4+)
|
||||
jta:
|
||||
enabled: true
|
||||
|
||||
# 注意:如果报 oracle.jdbc.xa.OracleXAResource.recover 错误,则需要授权如下:
|
||||
# grant select on sys.dba_pending_transactions to jeesite;
|
||||
@@ -164,27 +164,27 @@ spring:
|
||||
main:
|
||||
bannerMode: "off"
|
||||
|
||||
# # Redis 连接参数 (RedisProperties)
|
||||
# redis:
|
||||
# host: 127.0.0.1
|
||||
# port: 6379
|
||||
# ssl: false
|
||||
# database: 0
|
||||
# password: 1234
|
||||
# timeout: 2000
|
||||
# lettuce:
|
||||
# pool:
|
||||
# # 最大空闲连接数
|
||||
# maxIdle: 3
|
||||
# # 最大活动连接数
|
||||
# maxActive: 20
|
||||
# Redis 连接参数 (RedisProperties)
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
ssl: false
|
||||
database: 0
|
||||
password: 1234
|
||||
timeout: 2000
|
||||
lettuce:
|
||||
pool:
|
||||
# 最大空闲连接数
|
||||
maxIdle: 3
|
||||
# 最大活动连接数
|
||||
maxActive: 20
|
||||
|
||||
# # 缓存配置
|
||||
# cache:
|
||||
# # 缓存及会话共享(专业版)
|
||||
# isClusterMode: false
|
||||
# # 清理全部缓存按钮所清理的缓存列表
|
||||
# clearNames: sysCache,corpCache,userCache,cmsCache,msgPcPoolCache
|
||||
# 缓存配置
|
||||
cache:
|
||||
# 缓存及会话共享(专业版)
|
||||
isClusterMode: true
|
||||
# 清理全部缓存按钮所清理的缓存列表
|
||||
clearNames: sysCache,corpCache,userCache,cmsCache,msgPcPoolCache
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
@@ -207,8 +207,8 @@ logging:
|
||||
# pageSize: 20
|
||||
|
||||
# 用户相关
|
||||
#user:
|
||||
#
|
||||
user:
|
||||
|
||||
# # 指定超级管理员编号(研发团队使用的账号)
|
||||
# superAdminCode: system
|
||||
#
|
||||
@@ -264,28 +264,28 @@ logging:
|
||||
#
|
||||
# # 管理功能的控制权限类型(1拥有的权限 2管理的权限)(v4.1.5+)
|
||||
# adminCtrlPermi: 2
|
||||
#
|
||||
# # 多租户模式(SAAS模式)(专业版)
|
||||
# useCorpModel: false
|
||||
|
||||
# 多租户模式(SAAS模式)(专业版)
|
||||
useCorpModel: true
|
||||
|
||||
# 菜单管理
|
||||
#menu:
|
||||
# # 根据模块状态去更新相连的菜单状态(仅作为微服务时设为false)
|
||||
# updateStatusByModuleStatus: true
|
||||
# # 根据模块状态去更新相连的菜单状态
|
||||
# updateStatusByModuleStatus: false
|
||||
|
||||
# 国际化管理(专业版)
|
||||
#lang:
|
||||
# enabled: false
|
||||
#
|
||||
lang:
|
||||
enabled: true
|
||||
|
||||
# # 默认语言(4.1.3+)
|
||||
# defaultLocale: zh_CN
|
||||
# # 默认时区(4.1.3+)
|
||||
# defaultTimeZone: GMT+08:00
|
||||
|
||||
# 任务调度(个人版)
|
||||
#job:
|
||||
# enabled: false
|
||||
#
|
||||
job:
|
||||
enabled: true
|
||||
|
||||
# # 是否自动启动任务调度(可关闭)
|
||||
# autoStartup: true
|
||||
#
|
||||
@@ -364,8 +364,9 @@ shiro:
|
||||
#
|
||||
# # 登录提交信息加密(如果不需要加密,设置为空即可)
|
||||
# loginSubmit:
|
||||
# # 登录提交信息安全Key,加密用户名、密码、验证码,后再提交(key设置为3个,用逗号分隔)
|
||||
# # 登录提交信息安全Key,加密用户名、密码、验证码,后再提交(key设置为3个,用逗号分隔)默认加密方式:DES、Base64
|
||||
# secretKey: thinkgem,jeesite,com
|
||||
# secretKey: Base64
|
||||
|
||||
# 记住我密钥设置,为空则自动生成一个新密钥,也可以通过 com.jeesite.test.RememberMeKeyGen 生成
|
||||
rememberMe:
|
||||
@@ -578,9 +579,9 @@ shiro:
|
||||
#======================================#
|
||||
|
||||
# 消息提醒中心(专业版)
|
||||
#msg:
|
||||
# enabled: false
|
||||
#
|
||||
msg:
|
||||
enabled: true
|
||||
|
||||
# # 是否开启实时发送消息(保存消息后立即检查未读消息并发送),分布式部署下请单独配置消息发送服务,不建议开启此选项。
|
||||
# realtime:
|
||||
# # 是否开启
|
||||
|
||||
Reference in New Issue
Block a user