feat: 基础部分的国际化
This commit is contained in:
@@ -29,9 +29,9 @@ public class SecurityUtils {
|
||||
return json.toBean(CurrentUser.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return new CurrentUser();
|
||||
return CurrentUser.getDefaultUser();
|
||||
}
|
||||
return null;
|
||||
return CurrentUser.getDefaultUser();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -35,4 +35,12 @@ public class CurrentUser implements Serializable {
|
||||
private SysUser user;
|
||||
|
||||
private List<String> permissions = new ArrayList<>();
|
||||
|
||||
public static CurrentUser getDefaultUser() {
|
||||
CurrentUser def = new CurrentUser();
|
||||
def.setId("2");
|
||||
def.setUsername("default");
|
||||
def.setPresonName("外部系统用户");
|
||||
return def;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,15 +56,12 @@ public class UserController {
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<Object> query(UserQuery query, PageQuery page){
|
||||
return new ResponseEntity(TableDataInfo.build(userService.getUserDetail(query, page)),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("新增用户")
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<Object> create(@RequestBody Map user){
|
||||
userService.create(user);
|
||||
@@ -72,7 +69,6 @@ public class UserController {
|
||||
}
|
||||
|
||||
@Log("修改用户")
|
||||
|
||||
@PutMapping
|
||||
public ResponseEntity<Object> update( @RequestBody Map resources) throws Exception {
|
||||
userService.update(resources);
|
||||
@@ -80,7 +76,6 @@ public class UserController {
|
||||
}
|
||||
|
||||
@Log("修改用户:个人中心")
|
||||
|
||||
public ResponseEntity<Object> center(@RequestBody SysUser resources){
|
||||
if(!resources.getUser_id().equals(StpUtil.getLoginIdAsLong())){
|
||||
throw new BadRequestException(LangProcess.msg("error_SystemAuthError"));
|
||||
@@ -90,14 +85,12 @@ public class UserController {
|
||||
}
|
||||
|
||||
@Log("删除用户")
|
||||
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||
userService.removeByIds(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = "/updatePass")
|
||||
public ResponseEntity<Object> updatePass(@RequestBody JSONObject passVo) throws Exception {
|
||||
// 解密,得到字符密码
|
||||
@@ -122,7 +115,6 @@ public class UserController {
|
||||
}
|
||||
|
||||
@Log("修改邮箱")
|
||||
|
||||
@PostMapping(value = "/updateEmail/{code}")
|
||||
public ResponseEntity<Object> updateEmail(@PathVariable String code,@RequestBody SysUser user) throws Exception {
|
||||
String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,user.getPassword());
|
||||
|
||||
Reference in New Issue
Block a user