This commit is contained in:
Jason 2022-11-17 16:25:37 +08:00
commit 3137a59566
3 changed files with 14 additions and 4 deletions

View File

@ -24,8 +24,11 @@ public class StpInException {
@ResponseStatus(HttpStatus.OK)
@ExceptionHandler(NotLoginException.class)
@ResponseBody
public AjaxResult<Object> handleNotLoginException(){
return AjaxResult.failed(HttpEnum.TOKEN_INVALID.getCode(), HttpEnum.TOKEN_INVALID.getMsg());
public AjaxResult<Object> handleNotLoginException(NotLoginException e){
String msg = e.getMessage().split("")[0];
msg = msg.replaceFirst("Token", "");
msg = msg.trim().equals("") ? HttpEnum.TOKEN_INVALID.getMsg() : msg;
return AjaxResult.failed(HttpEnum.TOKEN_INVALID.getCode(), msg);
}
/**

View File

@ -22,7 +22,7 @@ import javax.annotation.Resource;
* 相册管理
*/
@RestController
@RequestMapping("api/common/album")
@RequestMapping("api/albums")
public class AlbumsController {
@Resource

View File

@ -370,6 +370,8 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
model.setDeleteTime(System.currentTimeMillis() / 1000);
systemAuthAdminMapper.updateById(model);
this.cacheAdminUserByUid(id);
StpUtil.kickout(id);
}
/**
@ -395,6 +397,10 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
systemAuthAdmin.setUpdateTime(TimeUtil.timestamp());
systemAuthAdminMapper.updateById(systemAuthAdmin);
this.cacheAdminUserByUid(id);
if (disable.equals(1)) {
StpUtil.kickout(id);
}
}
/**
@ -404,7 +410,7 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
public void cacheAdminUserByUid(Integer id) {
SystemAuthAdmin sysAdmin = systemAuthAdminMapper.selectOne(
new QueryWrapper<SystemAuthAdmin>()
.select("id,role,username,nickname,is_disable,is_delete")
.select("id,role,username,nickname,is_multipoint,is_disable,is_delete")
.eq("id", id)
.last("limit 1"));
@ -413,6 +419,7 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
user.put("roleId", sysAdmin.getRole());
user.put("username", sysAdmin.getUsername());
user.put("nickname", sysAdmin.getNickname());
user.put("isMultipoint", sysAdmin.getIsMultipoint());
user.put("isDisable", sysAdmin.getIsDisable());
user.put("isDelete", sysAdmin.getIsDelete());