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) @ResponseStatus(HttpStatus.OK)
@ExceptionHandler(NotLoginException.class) @ExceptionHandler(NotLoginException.class)
@ResponseBody @ResponseBody
public AjaxResult<Object> handleNotLoginException(){ public AjaxResult<Object> handleNotLoginException(NotLoginException e){
return AjaxResult.failed(HttpEnum.TOKEN_INVALID.getCode(), HttpEnum.TOKEN_INVALID.getMsg()); 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 @RestController
@RequestMapping("api/common/album") @RequestMapping("api/albums")
public class AlbumsController { public class AlbumsController {
@Resource @Resource

View File

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