文件上传https

This commit is contained in:
chen-xin-zhi 2025-03-17 09:11:00 +08:00
parent f17ed3829d
commit 19bdb53242
2 changed files with 7 additions and 1 deletions

View File

@ -148,6 +148,8 @@ public class UserController {
@Operation(summary = "小程序端用户获取登录信息", description = "参数:无,权限:所有人, 方法名getLoginUser")
public BaseResponse<UserVO> getLoginUser(HttpServletRequest request) {
User user = userService.getLoginUser(request);
// TODO
user.setUserAvatar(FileConstant.SERVER_HOST + user.getUserAvatar());
return ResultUtils.success(userService.getUserVO(user));
}
@ -162,6 +164,8 @@ public class UserController {
@AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
public BaseResponse<User> getWebLoginUser(HttpServletRequest request) {
User user = userService.getLoginUser(request);
// TODO
user.setUserAvatar(FileConstant.SERVER_HOST + user.getUserAvatar());
return ResultUtils.success(user);
}

View File

@ -1,5 +1,6 @@
package com.cultural.heritage.utils;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
public class DecoderUtils {
@ -7,6 +8,7 @@ public class DecoderUtils {
public static String decodeText (String text) {
// Base64 解码
byte [] decodedBytes = Base64.getDecoder().decode(text);
return new String(decodedBytes);
return new String(decodedBytes, StandardCharsets.UTF_8);
}
}