|
|
@@ -7,6 +7,7 @@ import java.util.Set;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.function.Function;
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
@@ -85,7 +86,10 @@ public class ApiTokenService {
|
|
|
*/
|
|
|
public void forcedLogoutByMobile(String mobile) {
|
|
|
// 获取护工对应的用户id
|
|
|
- User user = userService.loadByMobile(mobile, true);
|
|
|
+ User user = userService.loadByMobile(mobile, false);
|
|
|
+ if (ObjectUtil.isNull(user)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
Set<String> tokens = stringRedisTemplate.opsForSet().members(Constants.JWT_ONLINE_USER_TOKEN + user.getId());
|
|
|
if (CollUtil.isNotEmpty(tokens)) {
|
|
|
for (String token : tokens) {
|