增加/system/user/profile接口,修改上传路径

main
刘胜超 1 year ago
parent f82716219d
commit e87802e84c
  1. 2
      src/main/java/com/zilber/boot/file/service/UploadUtils.java
  2. 12
      src/main/java/com/zilber/boot/framework/config/ResourcesConfig.java
  3. 13
      src/main/java/com/zilber/boot/system/controller/SysProfileController.java
  4. 2
      src/main/resources/application.yml

@ -34,7 +34,7 @@ import java.util.stream.Collectors;
@Slf4j
public class UploadUtils {
@Value("${zilber.localtion}")
@Value("${zilberboot.profile}")
private String localtion;
@Resource

@ -26,15 +26,19 @@ public class ResourcesConfig implements WebMvcConfigurer
@Autowired
private RepeatSubmitInterceptor repeatSubmitInterceptor;
@Value("${zilber.localtion}")
private String localtion;
/* @Value("${zilberboot.profile}")
private String localtion;*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry)
{
/** 本地文件上传路径 */
/* *//** 本地文件上传路径 *//*
registry.addResourceHandler("/profile/**")
.addResourceLocations("file:" + localtion + "/");
.addResourceLocations("file:" + localtion + "/");*/
/** 本地文件上传路径 */
registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**")
.addResourceLocations("file:" + ZilberbootConfig.getProfile() + "/");
/** swagger配置 */
registry.addResourceHandler("/swagger-ui/**")

@ -36,6 +36,19 @@ public class SysProfileController extends BaseController
@Autowired
private TokenService tokenService;
/**
* 个人信息
*/
@GetMapping
public AjaxResult profile()
{
LoginUser loginUser = getLoginUser();
SysUser user = loginUser.getUser();
AjaxResult ajax = AjaxResult.success(user);
ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername()));
return ajax;
}
/**
* 修改用户

@ -7,7 +7,7 @@ zilberboot:
# 版权年份
copyrightYear: 2022
# 文件路径 示例( Windows配置D:/zilberboot/uploadPath,Linux配置 /home/zilberboot/uploadPath)
profile: D:/zilberboot/uploadPath
profile: C:/zilberboot/uploadPath
# 获取ip地址开关
addressEnabled: false
# 验证码类型 math 数组计算 char 字符验证

Loading…
Cancel
Save