Jeecg-Boot 2.1.4 版本发布 (新版问题修复)

This commit is contained in:
zhangdaiscott
2020-02-25 14:52:29 +08:00
parent 329802494f
commit bc79180ec7
6 changed files with 35 additions and 18 deletions

View File

@ -44,15 +44,18 @@
SELECT * FROM (
SELECT p.*
FROM sys_permission p
WHERE exists(
select a.id from sys_role_permission a
join sys_role b on a.role_id = b.id
join sys_user_role c on c.role_id = b.id
join sys_user d on d.id = c.user_id
where p.id = a.permission_id AND d.username = #{username,jdbcType=VARCHAR}
)
WHERE (exists(
select a.id from sys_role_permission a
join sys_role b on a.role_id = b.id
join sys_user_role c on c.role_id = b.id
join sys_user d on d.id = c.user_id
where p.id = a.permission_id AND d.username = #{username,jdbcType=VARCHAR}
)
<!--update begin Author:taoyan Date:20200225 for默认授权online的auto动态隐藏路由 -->
or (p.url like '%:code' and p.url like '/online%' and p.hidden = 1) )
<!--update end Author:taoyan Date:20200213 for默认授权online的auto动态隐藏路由 -->
and p.del_flag = 0
<!--update begin Author:lvdandan Date:20200213 for加入部门权限 -->
<!--update begin Author:lvdandan Date:20200225 for加入部门权限 -->
UNION
SELECT p.*
FROM sys_permission p

View File

@ -1,15 +1,17 @@
package org.jeecg.modules.system.util;
import sun.misc.BASE64Encoder;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Base64;
import java.util.Random;
/**
* 登录验证码工具类
*/
public class RandImageUtil {
public static final String key = "JEECG_LOGIN_KEY";
@ -69,9 +71,8 @@ public class RandImageUtil {
ImageIO.write(image, IMG_FORMAT, byteStream);
//转换成字节
byte[] bytes = byteStream.toByteArray();
BASE64Encoder encoder = new BASE64Encoder();
//转换成base64串
String base64 = encoder.encodeBuffer(bytes).trim();
String base64 = Base64.getEncoder().encodeToString(bytes).trim();
base64 = base64.replaceAll("\n", "").replaceAll("\r", "");//删除 \r\n
//写到指定位置