mirror of https://gitee.com/xiaonuobase/snowy
【更新】1.全局异常处理中数据操作异常打印日志,2.用户修改头像和签名后端统一压缩大小,3.数据库关系表中object_id和target_id大小调整为varchar 255,4.修复issues 中 #I5V2YK oracle版本的bug,5.sql统一导出最新版
parent
5dbebba20b
commit
98ab709793
|
@ -83,7 +83,6 @@ import vip.xiaonuo.sys.modular.user.service.SysUserService;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.awt.image.BufferedImage;
|
|
||||||
import java.io.BufferedOutputStream;
|
import java.io.BufferedOutputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -488,8 +487,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
SysUser sysUser = this.queryEntity(StpUtil.getLoginIdAsString());
|
SysUser sysUser = this.queryEntity(StpUtil.getLoginIdAsString());
|
||||||
try {
|
try {
|
||||||
String suffix = Objects.requireNonNull(FileUtil.getSuffix(file.getOriginalFilename())).toLowerCase();
|
String suffix = Objects.requireNonNull(FileUtil.getSuffix(file.getOriginalFilename())).toLowerCase();
|
||||||
BufferedImage bufferedImage = ImgUtil.toImage(file.getBytes());
|
String base64 = ImgUtil.toBase64DataUri(ImgUtil.scale(ImgUtil.toImage(file.getBytes()),
|
||||||
String base64 = ImgUtil.toBase64DataUri(bufferedImage, suffix);
|
100, 100, null), suffix);
|
||||||
this.update(new LambdaUpdateWrapper<SysUser>().eq(SysUser::getId,
|
this.update(new LambdaUpdateWrapper<SysUser>().eq(SysUser::getId,
|
||||||
sysUser.getId()).set(SysUser::getAvatar, base64));
|
sysUser.getId()).set(SysUser::getAvatar, base64));
|
||||||
return base64;
|
return base64;
|
||||||
|
@ -502,9 +501,15 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
@Override
|
@Override
|
||||||
public void updateSignature(SysUserSignatureParam sysUserSignatureParam) {
|
public void updateSignature(SysUserSignatureParam sysUserSignatureParam) {
|
||||||
SysUser sysUser = this.queryEntity(StpUtil.getLoginIdAsString());
|
SysUser sysUser = this.queryEntity(StpUtil.getLoginIdAsString());
|
||||||
|
String sysUserSignatureStr = sysUserSignatureParam.getSignature();
|
||||||
|
if(sysUserSignatureParam.getSignature().contains(StrUtil.COMMA)) {
|
||||||
|
sysUserSignatureStr = StrUtil.split(sysUserSignatureStr, StrUtil.COMMA).get(1);
|
||||||
|
}
|
||||||
|
String base64 = ImgUtil.toBase64DataUri(ImgUtil.scale(ImgUtil.toImage(sysUserSignatureStr),
|
||||||
|
100, 100, null), ImgUtil.IMAGE_TYPE_PNG);
|
||||||
// 更新指定字段
|
// 更新指定字段
|
||||||
this.update(new LambdaUpdateWrapper<SysUser>().eq(SysUser::getId, sysUser.getId())
|
this.update(new LambdaUpdateWrapper<SysUser>().eq(SysUser::getId, sysUser.getId())
|
||||||
.set(SysUser::getSignature, sysUserSignatureParam.getSignature()));
|
.set(SysUser::getSignature, base64));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -125,9 +125,11 @@ public class GlobalExceptionUtil {
|
||||||
CommonException commonException = (CommonException) secondCause;
|
CommonException commonException = (CommonException) secondCause;
|
||||||
commonResult = CommonResult.get(commonException.getCode(), commonException.getMsg(), null);
|
commonResult = CommonResult.get(commonException.getCode(), commonException.getMsg(), null);
|
||||||
} else {
|
} else {
|
||||||
|
e.printStackTrace();
|
||||||
commonResult = CommonResult.error("数据操作异常");
|
commonResult = CommonResult.error("数据操作异常");
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
|
e.printStackTrace();
|
||||||
commonResult = CommonResult.error("数据操作异常");
|
commonResult = CommonResult.error("数据操作异常");
|
||||||
}
|
}
|
||||||
} else if (e instanceof CommonException) {
|
} else if (e instanceof CommonException) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -2,7 +2,7 @@
|
||||||
# server configuration
|
# server configuration
|
||||||
#########################################
|
#########################################
|
||||||
server.port=82
|
server.port=82
|
||||||
server.max-http-header-size=10240
|
server.max-http-header-size=100MB
|
||||||
|
|
||||||
#########################################
|
#########################################
|
||||||
# spring profiles configuration
|
# spring profiles configuration
|
||||||
|
@ -89,6 +89,7 @@ spring.redis.lettuce.pool.min-idle=0
|
||||||
# mybatis-plus configuration
|
# mybatis-plus configuration
|
||||||
#########################################
|
#########################################
|
||||||
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
|
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
|
mybatis-plus.configuration.jdbc-type-for-null=null
|
||||||
mybatis-plus.global-config.banner=false
|
mybatis-plus.global-config.banner=false
|
||||||
mybatis-plus.global-config.db-config.id-type=ASSIGN_ID
|
mybatis-plus.global-config.db-config.id-type=ASSIGN_ID
|
||||||
mybatis-plus.global-config.db-config.logic-delete-field=DELETE_FLAG
|
mybatis-plus.global-config.db-config.logic-delete-field=DELETE_FLAG
|
||||||
|
@ -96,10 +97,6 @@ mybatis-plus.global-config.db-config.logic-delete-value=DELETED
|
||||||
mybatis-plus.global-config.db-config.logic-not-delete-value=NOT_DELETE
|
mybatis-plus.global-config.db-config.logic-not-delete-value=NOT_DELETE
|
||||||
mybatis-plus.mapper-locations=classpath*:vip/xiaonuo/**/mapping/*.xml
|
mybatis-plus.mapper-locations=classpath*:vip/xiaonuo/**/mapping/*.xml
|
||||||
mybatis-plus.type-handlers-package=vip.xiaonuo.common.handler
|
mybatis-plus.type-handlers-package=vip.xiaonuo.common.handler
|
||||||
#如果数据库为postgresql,则需要配置为blobType: BINARY
|
|
||||||
mybatis-plus.configuration-properties.blobType=BLOB
|
|
||||||
#如果数据库为oracle或mssql,则需要配置为boolValue: 1
|
|
||||||
mybatis-plus.configuration-properties.boolValue=false
|
|
||||||
|
|
||||||
#########################################
|
#########################################
|
||||||
# easy-trans configuration
|
# easy-trans configuration
|
||||||
|
|
Loading…
Reference in New Issue