|
@@ -96,7 +96,7 @@ public class CommonController {
|
|
|
|
|
|
if ("image".equalsIgnoreCase(fileType)) {
|
|
|
//获取用户名
|
|
|
- String username = SecurityUtils.getUsername();
|
|
|
+ String nickName = SecurityUtils.getLoginUser().getUser().getNickName();
|
|
|
// 原始文件
|
|
|
if (fileName.contains("/profile/upload")) {
|
|
|
fileName = fileName.replace("/profile/upload", "");
|
|
@@ -107,7 +107,7 @@ public class CommonController {
|
|
|
String watermarkFileName = "watermark_" + fileName;
|
|
|
File destFile = new File(filePath + fileName);
|
|
|
// 加水印
|
|
|
- ImageUtils.addWatermark(sourceFile, destFile, "@" + username, "次元时代-ACG爱好者社区");
|
|
|
+ ImageUtils.addWatermark(sourceFile, destFile, "@" + nickName, "次元时代-ACG爱好者社区");
|
|
|
fileName = watermarkFileName;
|
|
|
}
|
|
|
|