文件上传https
This commit is contained in:
parent
f17ed3829d
commit
19bdb53242
|
@ -148,6 +148,8 @@ public class UserController {
|
||||||
@Operation(summary = "小程序端用户获取登录信息", description = "参数:无,权限:所有人, 方法名:getLoginUser")
|
@Operation(summary = "小程序端用户获取登录信息", description = "参数:无,权限:所有人, 方法名:getLoginUser")
|
||||||
public BaseResponse<UserVO> getLoginUser(HttpServletRequest request) {
|
public BaseResponse<UserVO> getLoginUser(HttpServletRequest request) {
|
||||||
User user = userService.getLoginUser(request);
|
User user = userService.getLoginUser(request);
|
||||||
|
// TODO
|
||||||
|
user.setUserAvatar(FileConstant.SERVER_HOST + user.getUserAvatar());
|
||||||
return ResultUtils.success(userService.getUserVO(user));
|
return ResultUtils.success(userService.getUserVO(user));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,6 +164,8 @@ public class UserController {
|
||||||
@AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
|
@AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
|
||||||
public BaseResponse<User> getWebLoginUser(HttpServletRequest request) {
|
public BaseResponse<User> getWebLoginUser(HttpServletRequest request) {
|
||||||
User user = userService.getLoginUser(request);
|
User user = userService.getLoginUser(request);
|
||||||
|
// TODO
|
||||||
|
user.setUserAvatar(FileConstant.SERVER_HOST + user.getUserAvatar());
|
||||||
return ResultUtils.success(user);
|
return ResultUtils.success(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.cultural.heritage.utils;
|
package com.cultural.heritage.utils;
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
|
|
||||||
public class DecoderUtils {
|
public class DecoderUtils {
|
||||||
|
@ -7,6 +8,7 @@ public class DecoderUtils {
|
||||||
public static String decodeText (String text) {
|
public static String decodeText (String text) {
|
||||||
// Base64 解码
|
// Base64 解码
|
||||||
byte [] decodedBytes = Base64.getDecoder().decode(text);
|
byte [] decodedBytes = Base64.getDecoder().decode(text);
|
||||||
return new String(decodedBytes);
|
|
||||||
|
return new String(decodedBytes, StandardCharsets.UTF_8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user