增加/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 @Slf4j
public class UploadUtils { public class UploadUtils {
@Value("${zilber.localtion}") @Value("${zilberboot.profile}")
private String localtion; private String localtion;
@Resource @Resource

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

@ -36,6 +36,19 @@ public class SysProfileController extends BaseController
@Autowired @Autowired
private TokenService tokenService; 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 copyrightYear: 2022
# 文件路径 示例( Windows配置D:/zilberboot/uploadPath,Linux配置 /home/zilberboot/uploadPath) # 文件路径 示例( Windows配置D:/zilberboot/uploadPath,Linux配置 /home/zilberboot/uploadPath)
profile: D:/zilberboot/uploadPath profile: C:/zilberboot/uploadPath
# 获取ip地址开关 # 获取ip地址开关
addressEnabled: false addressEnabled: false
# 验证码类型 math 数组计算 char 字符验证 # 验证码类型 math 数组计算 char 字符验证

Loading…
Cancel
Save