修改
This commit is contained in:
@@ -28,6 +28,7 @@ import org.aspectj.lang.reflect.MethodSignature;
|
|||||||
import org.nl.domain.Log;
|
import org.nl.domain.Log;
|
||||||
import org.nl.service.LogService;
|
import org.nl.service.LogService;
|
||||||
import org.nl.utils.RequestHolder;
|
import org.nl.utils.RequestHolder;
|
||||||
|
import org.nl.utils.SecurityUtils;
|
||||||
import org.nl.utils.StringUtils;
|
import org.nl.utils.StringUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
@@ -139,8 +140,7 @@ public class LogAspect {
|
|||||||
|
|
||||||
public String getUsername() {
|
public String getUsername() {
|
||||||
try {
|
try {
|
||||||
// return SecurityUtils.getCurrentUsername();
|
return SecurityUtils.getCurrentUsername();
|
||||||
return "";
|
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import org.nl.annotation.Log;
|
import org.nl.annotation.Log;
|
||||||
import org.nl.service.LogService;
|
import org.nl.service.LogService;
|
||||||
import org.nl.service.dto.LogQueryCriteria;
|
import org.nl.service.dto.LogQueryCriteria;
|
||||||
|
import org.nl.utils.SecurityUtils;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -49,8 +50,7 @@ public class LogController {
|
|||||||
// @ApiOperation("用户日志查询")
|
// @ApiOperation("用户日志查询")
|
||||||
public ResponseEntity<Object> queryUserLog(LogQueryCriteria criteria, Pageable pageable){
|
public ResponseEntity<Object> queryUserLog(LogQueryCriteria criteria, Pageable pageable){
|
||||||
criteria.setLogType("INFO");
|
criteria.setLogType("INFO");
|
||||||
// criteria.setBlurry(SecurityUtils.getCurrentUsername());
|
criteria.setBlurry(SecurityUtils.getCurrentUsername());
|
||||||
criteria.setBlurry("");
|
|
||||||
return new ResponseEntity<>(logService.queryAllByUser(criteria,pageable), HttpStatus.OK);
|
return new ResponseEntity<>(logService.queryAllByUser(criteria,pageable), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ public class DeployServiceImpl implements DeployService {
|
|||||||
//还原信息入库
|
//还原信息入库
|
||||||
DeployHistory deployHistory = new DeployHistory();
|
DeployHistory deployHistory = new DeployHistory();
|
||||||
deployHistory.setAppName(appName);
|
deployHistory.setAppName(appName);
|
||||||
// deployHistory.setDeployUser(SecurityUtils.getCurrentUsername());
|
deployHistory.setDeployUser(SecurityUtils.getCurrentUsername());
|
||||||
deployHistory.setIp(ip);
|
deployHistory.setIp(ip);
|
||||||
deployHistory.setDeployId(id);
|
deployHistory.setDeployId(id);
|
||||||
deployHistoryService.create(deployHistory);
|
deployHistoryService.create(deployHistory);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.nl.modules.security.satoken;
|
package org.nl.modules.security.satoken;
|
||||||
|
|
||||||
import cn.dev33.satoken.stp.StpInterface;
|
import cn.dev33.satoken.stp.StpInterface;
|
||||||
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
import org.nl.modules.system.service.RoleService;
|
import org.nl.modules.system.service.RoleService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -18,23 +19,11 @@ public class StpInterfaceImpl implements StpInterface {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RoleService roleService;
|
private RoleService roleService;
|
||||||
|
|
||||||
/**
|
|
||||||
* 权限校验 - 获取用户权限
|
|
||||||
* @param o
|
|
||||||
* @param s
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getPermissionList(Object o, String s) {
|
public List<String> getPermissionList(Object o, String s) {
|
||||||
return roleService.getPermissionList((String) o);
|
return roleService.getPermissionList((String) StpUtil.getLoginId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取用户角色
|
|
||||||
* @param o
|
|
||||||
* @param s
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getRoleList(Object o, String s) {
|
public List<String> getRoleList(Object o, String s) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -84,8 +84,7 @@ public class UserController {
|
|||||||
criteria.getDeptIds().addAll(deptService.getDeptChildren(deptService.findByPid(criteria.getDeptId())));
|
criteria.getDeptIds().addAll(deptService.getDeptChildren(deptService.findByPid(criteria.getDeptId())));
|
||||||
}
|
}
|
||||||
// 数据权限
|
// 数据权限
|
||||||
// List<Long> dataScopes = dataService.getDeptIds(userService.findByName(SecurityUtils.getCurrentUsername()));
|
List<Long> dataScopes = dataService.getDeptIds(userService.findByName(SecurityUtils.getCurrentUsername()));
|
||||||
List<Long> dataScopes = dataService.getDeptIds(userService.findByName(""));
|
|
||||||
// criteria.getDeptIds() 不为空并且数据权限不为空则取交集
|
// criteria.getDeptIds() 不为空并且数据权限不为空则取交集
|
||||||
if (!CollectionUtils.isEmpty(criteria.getDeptIds()) && !CollectionUtils.isEmpty(dataScopes)){
|
if (!CollectionUtils.isEmpty(criteria.getDeptIds()) && !CollectionUtils.isEmpty(dataScopes)){
|
||||||
// 取交集
|
// 取交集
|
||||||
@@ -178,8 +177,7 @@ public class UserController {
|
|||||||
@PostMapping(value = "/updateEmail/{code}")
|
@PostMapping(value = "/updateEmail/{code}")
|
||||||
public ResponseEntity<Object> updateEmail(@PathVariable String code,@RequestBody User user) throws Exception {
|
public ResponseEntity<Object> updateEmail(@PathVariable String code,@RequestBody User user) throws Exception {
|
||||||
String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,user.getPassword());
|
String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,user.getPassword());
|
||||||
// UserDto userDto = userService.findByName(SecurityUtils.getCurrentUsername());
|
UserDto userDto = userService.findByName(SecurityUtils.getCurrentUsername());
|
||||||
UserDto userDto = userService.findByName("");
|
|
||||||
// if(!passwordEncoder.matches(password, userDto.getPassword())){
|
// if(!passwordEncoder.matches(password, userDto.getPassword())){
|
||||||
// throw new BadRequestException("密码错误");
|
// throw new BadRequestException("密码错误");
|
||||||
// }
|
// }
|
||||||
|
|||||||
@@ -2,9 +2,10 @@ package org.nl.modules.system.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.nl.modules.system.service.CodeDetailService;
|
import org.nl.modules.system.service.CodeDetailService;
|
||||||
|
import org.nl.utils.SecurityUtils;
|
||||||
import org.nl.wql.core.bean.ResultBean;
|
import org.nl.wql.core.bean.ResultBean;
|
||||||
import org.nl.wql.core.bean.WQLObject;
|
import org.nl.wql.core.bean.WQLObject;
|
||||||
import org.nl.wql.util.WqlUtil;
|
import org.nl.wql.util.WqlUtil;
|
||||||
@@ -47,7 +48,7 @@ public class CodeDetailServiceImpl implements CodeDetailService {
|
|||||||
json.put("code_rule_id",dict.get("id"));
|
json.put("code_rule_id",dict.get("id"));
|
||||||
json.put("is_active","1");
|
json.put("is_active","1");
|
||||||
json.put("is_delete","0");
|
json.put("is_delete","0");
|
||||||
// json.put("create_by",SecurityUtils.getCurrentUsername());
|
json.put("create_by", SecurityUtils.getCurrentUsername());
|
||||||
json.put("create_time", now);
|
json.put("create_time", now);
|
||||||
if(form.get("type").equals("02")){
|
if(form.get("type").equals("02")){
|
||||||
Date date = DateUtil.date();
|
Date date = DateUtil.date();
|
||||||
@@ -68,7 +69,7 @@ public class CodeDetailServiceImpl implements CodeDetailService {
|
|||||||
public void update(JSONObject json) {
|
public void update(JSONObject json) {
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
json.put("update_time",now);
|
json.put("update_time",now);
|
||||||
// json.put("update_by", SecurityUtils.getCurrentUsername());
|
json.put("update_by", SecurityUtils.getCurrentUsername());
|
||||||
WQLObject.getWQLObject("sys_code_rule_detail").update(json);
|
WQLObject.getWQLObject("sys_code_rule_detail").update(json);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,11 +3,12 @@ package org.nl.modules.system.service.impl;
|
|||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.nl.exception.BadRequestException;
|
import org.nl.exception.BadRequestException;
|
||||||
import org.nl.modules.system.service.GenCodeService;
|
import org.nl.modules.system.service.GenCodeService;
|
||||||
|
import org.nl.utils.SecurityUtils;
|
||||||
import org.nl.wql.core.bean.ResultBean;
|
import org.nl.wql.core.bean.ResultBean;
|
||||||
import org.nl.wql.core.bean.WQLObject;
|
import org.nl.wql.core.bean.WQLObject;
|
||||||
import org.nl.wql.util.WqlUtil;
|
import org.nl.wql.util.WqlUtil;
|
||||||
@@ -63,7 +64,7 @@ public class GenCodeServiceImpl implements GenCodeService {
|
|||||||
json.put("name", form.get("name"));
|
json.put("name", form.get("name"));
|
||||||
json.put("is_active", "1");
|
json.put("is_active", "1");
|
||||||
json.put("is_delete", "0");
|
json.put("is_delete", "0");
|
||||||
// json.put("create_by", SecurityUtils.getCurrentUsername());
|
json.put("create_by", SecurityUtils.getCurrentUsername());
|
||||||
json.put("create_time", now);
|
json.put("create_time", now);
|
||||||
WQLObject.getWQLObject("sys_code_rule").insert(json);
|
WQLObject.getWQLObject("sys_code_rule").insert(json);
|
||||||
}
|
}
|
||||||
@@ -87,7 +88,7 @@ public class GenCodeServiceImpl implements GenCodeService {
|
|||||||
}
|
}
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
json.put("update_time", now);
|
json.put("update_time", now);
|
||||||
// json.put("update_by", SecurityUtils.getCurrentUsername());
|
json.put("update_by", SecurityUtils.getCurrentUsername());
|
||||||
WQLObject.getWQLObject("sys_code_rule").update(json);
|
WQLObject.getWQLObject("sys_code_rule").update(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.nl.exception.BadRequestException;
|
import org.nl.exception.BadRequestException;
|
||||||
import org.nl.modules.system.service.GridFieldService;
|
import org.nl.modules.system.service.GridFieldService;
|
||||||
import org.nl.modules.system.service.dto.GridFieldDto;
|
import org.nl.modules.system.service.dto.GridFieldDto;
|
||||||
|
import org.nl.utils.SecurityUtils;
|
||||||
import org.nl.wql.WQL;
|
import org.nl.wql.WQL;
|
||||||
import org.nl.wql.core.bean.WQLObject;
|
import org.nl.wql.core.bean.WQLObject;
|
||||||
import org.nl.wql.util.WqlUtil;
|
import org.nl.wql.util.WqlUtil;
|
||||||
@@ -45,8 +46,7 @@ public class GridFieldServiceImpl implements GridFieldService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void create(GridFieldDto dto) {
|
public void create(GridFieldDto dto) {
|
||||||
// String currentUsername = SecurityUtils.getCurrentUsername();
|
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||||
String currentUsername = "";
|
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
|
|
||||||
dto.setId(IdUtil.simpleUUID());
|
dto.setId(IdUtil.simpleUUID());
|
||||||
@@ -74,8 +74,7 @@ public class GridFieldServiceImpl implements GridFieldService {
|
|||||||
GridFieldDto entity = this.findById(dto.getId());
|
GridFieldDto entity = this.findById(dto.getId());
|
||||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||||
|
|
||||||
// String currentUsername = SecurityUtils.getCurrentUsername();
|
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||||
String currentUsername = "";
|
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
dto.setUpdate_time(now);
|
dto.setUpdate_time(now);
|
||||||
dto.setUpdate_by(currentUsername);
|
dto.setUpdate_by(currentUsername);
|
||||||
@@ -103,8 +102,7 @@ public class GridFieldServiceImpl implements GridFieldService {
|
|||||||
String grid_id = json.getString("grid_id");
|
String grid_id = json.getString("grid_id");
|
||||||
JSONArray fieldDatas = json.getJSONArray("gridFieldData");
|
JSONArray fieldDatas = json.getJSONArray("gridFieldData");
|
||||||
WQLObject wo = WQLObject.getWQLObject("sys_grid_field");
|
WQLObject wo = WQLObject.getWQLObject("sys_grid_field");
|
||||||
// String currentUsername = SecurityUtils.getCurrentUsername();
|
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||||
String currentUsername = "";
|
|
||||||
// 先删除原先所有的数据
|
// 先删除原先所有的数据
|
||||||
wo.delete("grid_id = '" + grid_id + "'");
|
wo.delete("grid_id = '" + grid_id + "'");
|
||||||
// 然后添加
|
// 然后添加
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.nl.exception.BadRequestException;
|
import org.nl.exception.BadRequestException;
|
||||||
import org.nl.modules.system.service.GridService;
|
import org.nl.modules.system.service.GridService;
|
||||||
import org.nl.modules.system.service.dto.GridDto;
|
import org.nl.modules.system.service.dto.GridDto;
|
||||||
|
import org.nl.utils.SecurityUtils;
|
||||||
import org.nl.wql.core.bean.ResultBean;
|
import org.nl.wql.core.bean.ResultBean;
|
||||||
import org.nl.wql.core.bean.WQLObject;
|
import org.nl.wql.core.bean.WQLObject;
|
||||||
import org.nl.wql.util.WqlUtil;
|
import org.nl.wql.util.WqlUtil;
|
||||||
@@ -42,8 +43,7 @@ public class GridServiceImpl implements GridService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void create(GridDto dto) {
|
public void create(GridDto dto) {
|
||||||
// String currentUsername = SecurityUtils.getCurrentUsername();
|
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||||
String currentUsername = "";
|
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
|
|
||||||
dto.setId(IdUtil.simpleUUID());
|
dto.setId(IdUtil.simpleUUID());
|
||||||
@@ -71,8 +71,7 @@ public class GridServiceImpl implements GridService {
|
|||||||
GridDto entity = this.findById(dto.getId());
|
GridDto entity = this.findById(dto.getId());
|
||||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||||
|
|
||||||
// String currentUsername = SecurityUtils.getCurrentUsername();
|
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||||
String currentUsername = "";
|
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
dto.setUpdate_time(now);
|
dto.setUpdate_time(now);
|
||||||
dto.setUpdate_by(currentUsername);
|
dto.setUpdate_by(currentUsername);
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import org.nl.exception.BadRequestException;
|
|||||||
import org.nl.modules.system.service.ParamService;
|
import org.nl.modules.system.service.ParamService;
|
||||||
import org.nl.modules.system.service.dto.ParamDto;
|
import org.nl.modules.system.service.dto.ParamDto;
|
||||||
import org.nl.utils.FileUtil;
|
import org.nl.utils.FileUtil;
|
||||||
|
import org.nl.utils.SecurityUtils;
|
||||||
import org.nl.wql.core.bean.ResultBean;
|
import org.nl.wql.core.bean.ResultBean;
|
||||||
import org.nl.wql.core.bean.WQLObject;
|
import org.nl.wql.core.bean.WQLObject;
|
||||||
import org.nl.wql.util.WqlUtil;
|
import org.nl.wql.util.WqlUtil;
|
||||||
@@ -71,8 +72,7 @@ public class ParamServiceImpl implements ParamService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void create(ParamDto dto) {
|
public void create(ParamDto dto) {
|
||||||
// String currentUsername = SecurityUtils.getCurrentUsername();
|
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||||
String currentUsername = "";
|
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
|
|
||||||
dto.setId(IdUtil.simpleUUID());
|
dto.setId(IdUtil.simpleUUID());
|
||||||
@@ -92,8 +92,7 @@ public class ParamServiceImpl implements ParamService {
|
|||||||
ParamDto entity = this.findById(dto.getId());
|
ParamDto entity = this.findById(dto.getId());
|
||||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||||
|
|
||||||
// String currentUsername = SecurityUtils.getCurrentUsername();
|
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||||
String currentUsername = "";
|
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
dto.setUpdate_time(now);
|
dto.setUpdate_time(now);
|
||||||
dto.setUpdate_by(currentUsername);
|
dto.setUpdate_by(currentUsername);
|
||||||
|
|||||||
@@ -16,14 +16,12 @@
|
|||||||
package org.nl.modules.system.service.impl;
|
package org.nl.modules.system.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.nl.exception.BadRequestException;
|
import org.nl.exception.BadRequestException;
|
||||||
import org.nl.exception.EntityExistException;
|
import org.nl.exception.EntityExistException;
|
||||||
import org.nl.modules.security.service.UserCacheClean;
|
import org.nl.modules.security.service.UserCacheClean;
|
||||||
import org.nl.modules.system.domain.Menu;
|
|
||||||
import org.nl.modules.system.domain.Role;
|
import org.nl.modules.system.domain.Role;
|
||||||
import org.nl.modules.system.domain.User;
|
import org.nl.modules.system.domain.User;
|
||||||
import org.nl.modules.system.repository.RoleRepository;
|
import org.nl.modules.system.repository.RoleRepository;
|
||||||
@@ -32,7 +30,6 @@ import org.nl.modules.system.service.RoleService;
|
|||||||
import org.nl.modules.system.service.dto.RoleDto;
|
import org.nl.modules.system.service.dto.RoleDto;
|
||||||
import org.nl.modules.system.service.dto.RoleQueryCriteria;
|
import org.nl.modules.system.service.dto.RoleQueryCriteria;
|
||||||
import org.nl.modules.system.service.dto.RoleSmallDto;
|
import org.nl.modules.system.service.dto.RoleSmallDto;
|
||||||
import org.nl.modules.system.service.dto.UserDto;
|
|
||||||
import org.nl.modules.system.service.mapstruct.RoleMapper;
|
import org.nl.modules.system.service.mapstruct.RoleMapper;
|
||||||
import org.nl.modules.system.service.mapstruct.RoleSmallMapper;
|
import org.nl.modules.system.service.mapstruct.RoleSmallMapper;
|
||||||
import org.nl.utils.*;
|
import org.nl.utils.*;
|
||||||
@@ -183,7 +180,7 @@ public class RoleServiceImpl implements RoleService {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Cacheable(key = "'auth:' + #p0.id")
|
@Cacheable(key = "'auth:' + #p0")
|
||||||
public List<String> getPermissionList(String id) {
|
public List<String> getPermissionList(String id) {
|
||||||
List<String> permission = new LinkedList<>();
|
List<String> permission = new LinkedList<>();
|
||||||
HashMap<String, String> map = new HashMap<>();
|
HashMap<String, String> map = new HashMap<>();
|
||||||
|
|||||||
@@ -184,8 +184,7 @@ public class UserServiceImpl implements UserService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Map<String, String> updateAvatar(MultipartFile multipartFile) {
|
public Map<String, String> updateAvatar(MultipartFile multipartFile) {
|
||||||
// User user = userRepository.findByUsername(SecurityUtils.getCurrentUsername());
|
User user = userRepository.findByUsername(SecurityUtils.getCurrentUsername());
|
||||||
User user = userRepository.findByUsername("");
|
|
||||||
String oldPath = user.getAvatarPath();
|
String oldPath = user.getAvatarPath();
|
||||||
File file = FileUtil.upload(multipartFile, properties.getPath().getAvatar());
|
File file = FileUtil.upload(multipartFile, properties.getPath().getAvatar());
|
||||||
user.setAvatarPath(Objects.requireNonNull(file).getPath());
|
user.setAvatarPath(Objects.requireNonNull(file).getPath());
|
||||||
|
|||||||
Reference in New Issue
Block a user