|
@@ -256,7 +256,12 @@ public class LoginService {
|
|
if (ToolUtil.isEmpty(token)) {
|
|
if (ToolUtil.isEmpty(token)) {
|
|
throw new BusinessException(ExceptionEnum.THE_LOG_OUT);
|
|
throw new BusinessException(ExceptionEnum.THE_LOG_OUT);
|
|
}
|
|
}
|
|
- String usedToken = token.substring(token.indexOf("=") + 1);
|
|
|
|
|
|
+ String usedToken = "";
|
|
|
|
+ if (token.contains("=")) {
|
|
|
|
+ usedToken = token.substring(token.indexOf("=") + 1);
|
|
|
|
+ } else {
|
|
|
|
+ usedToken = token;
|
|
|
|
+ }
|
|
PersonnelVO personnelVO = cacheUtil.getLoginUser(usedToken);
|
|
PersonnelVO personnelVO = cacheUtil.getLoginUser(usedToken);
|
|
if (ToolUtil.isEmpty(personnelVO)) {
|
|
if (ToolUtil.isEmpty(personnelVO)) {
|
|
throw new BusinessException(ExceptionEnum.THE_LOG_OUT);
|
|
throw new BusinessException(ExceptionEnum.THE_LOG_OUT);
|
|
@@ -298,7 +303,12 @@ public class LoginService {
|
|
*/
|
|
*/
|
|
public boolean logout(PersonIdDTO dto) {
|
|
public boolean logout(PersonIdDTO dto) {
|
|
String token = LoginUtils.getToken();
|
|
String token = LoginUtils.getToken();
|
|
- String usedToken = token.substring(token.indexOf("=") + 1);
|
|
|
|
|
|
+ String usedToken = "";
|
|
|
|
+ if (token.contains("=")) {
|
|
|
|
+ usedToken = token.substring(token.indexOf("=") + 1);
|
|
|
|
+ } else {
|
|
|
|
+ usedToken = token;
|
|
|
|
+ }
|
|
redisService.delete(usedToken);
|
|
redisService.delete(usedToken);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|