fix: 退出登录区分客户和用户
This commit is contained in:
@@ -77,11 +77,16 @@ public class TokenController {
|
|||||||
String token = SecurityUtils.getToken(request);
|
String token = SecurityUtils.getToken(request);
|
||||||
if (StringUtils.isNotEmpty(token)) {
|
if (StringUtils.isNotEmpty(token)) {
|
||||||
String username = JwtUtils.getUserName(token);
|
String username = JwtUtils.getUserName(token);
|
||||||
|
String userPlatform = JwtUtils.getUserPlatform(token);
|
||||||
// 删除用户缓存记录
|
// 删除用户缓存记录
|
||||||
AuthUtil.logoutByToken(token);
|
AuthUtil.logoutByToken(token);
|
||||||
// 记录用户退出日志
|
// 记录用户退出日志
|
||||||
|
if ("user".equals(userPlatform)) {
|
||||||
|
uLoginService.logout(username);
|
||||||
|
} else {
|
||||||
sysLoginService.logout(username);
|
sysLoginService.logout(username);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,13 +120,14 @@ public class TokenController {
|
|||||||
uLoginService.checkRepeat(form);
|
uLoginService.checkRepeat(form);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
if ("sys".equals(form.getAuthType())) {}
|
if ("sys".equals(form.getAuthType())) {
|
||||||
|
}
|
||||||
return R.fail("auth.authentication.type.not.supported");
|
return R.fail("auth.authentication.type.not.supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("health")
|
@GetMapping("health")
|
||||||
public R<?> health(HttpServletRequest request) {
|
public R<?> health(HttpServletRequest request) {
|
||||||
// check health
|
// check health
|
||||||
return R.ok(null,"auth.is.healthy");
|
return R.ok(null, "auth.is.healthy");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,9 @@ public class UClientServiceImpl extends ServiceImpl<UClientMapper, UClient> impl
|
|||||||
}
|
}
|
||||||
boolean flag = this.saveOrUpdate(uClient);
|
boolean flag = this.saveOrUpdate(uClient);
|
||||||
// 登录时如果当前用户有可用套餐和余额授权当前设备访问wifi,且根据套餐限制带宽
|
// 登录时如果当前用户有可用套餐和余额授权当前设备访问wifi,且根据套餐限制带宽
|
||||||
|
if (StrUtil.isNotBlank(uClientBo.getClientName()) && StrUtil.isNotBlank(uClientBo.getSiteId())) {
|
||||||
accountService.authClientAndRateLimit(uClientBo);
|
accountService.authClientAndRateLimit(uClientBo);
|
||||||
|
}
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user