From effa1ef257974535ef0a291eecbf9b063a03b297 Mon Sep 17 00:00:00 2001 From: thinkgem Date: Thu, 12 Mar 2020 22:06:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=8F=90=E4=BA=A4=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=8A=A0=E5=AF=86=EF=BC=8C=E6=96=B0=E5=A2=9EBase64?= =?UTF-8?q?=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/jeesite/common/codec/DesUtils.java | 6 ++ .../src/main/resources/static/common/des.js | 6 ++ .../main/resources/config/jeesite-core.yml | 5 +- .../themes/default/modules/sys/sysLogin.html | 6 +- web/src/main/resources/config/application.yml | 85 ++++++++++--------- 5 files changed, 61 insertions(+), 47 deletions(-) diff --git a/common/src/main/java/com/jeesite/common/codec/DesUtils.java b/common/src/main/java/com/jeesite/common/codec/DesUtils.java index 94df9245..ee24fbd8 100644 --- a/common/src/main/java/com/jeesite/common/codec/DesUtils.java +++ b/common/src/main/java/com/jeesite/common/codec/DesUtils.java @@ -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]); diff --git a/common/src/main/resources/static/common/des.js b/common/src/main/resources/static/common/des.js index 080ab468..080c2979 100644 --- a/common/src/main/resources/static/common/des.js +++ b/common/src/main/resources/static/common/des.js @@ -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]); diff --git a/modules/core/src/main/resources/config/jeesite-core.yml b/modules/core/src/main/resources/config/jeesite-core.yml index fdd3186b..3e7c1e3d 100644 --- a/modules/core/src/main/resources/config/jeesite-core.yml +++ b/modules/core/src/main/resources/config/jeesite-core.yml @@ -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: diff --git a/modules/core/src/main/resources/views/themes/default/modules/sys/sysLogin.html b/modules/core/src/main/resources/views/themes/default/modules/sys/sysLogin.html index 4355078f..e2f225e6 100644 --- a/modules/core/src/main/resources/views/themes/default/modules/sys/sysLogin.html +++ b/modules/core/src/main/resources/views/themes/default/modules/sys/sysLogin.html @@ -76,11 +76,11 @@ <% } %> - - + \ No newline at end of file diff --git a/web/src/main/resources/config/application.yml b/web/src/main/resources/config/application.yml index 05530b3f..edb2a8a3 100644 --- a/web/src/main/resources/config/application.yml +++ b/web/src/main/resources/config/application.yml @@ -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: # # 是否开启