修复H5登录与app冲突问题
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package com.accompany.oauth2.service;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.accompany.common.constant.AppEnum;
|
||||
import com.accompany.common.constant.ApplicationConstant;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.device.DeviceInfo;
|
||||
import com.accompany.common.redis.RedisKey;
|
||||
@@ -26,6 +28,7 @@ import com.accompany.oauth2.service.account.AccountBlockCheckService;
|
||||
import com.accompany.oauth2.service.account.AccountManageService;
|
||||
import com.accompany.oauth2.util.RequestContextHolderUtils;
|
||||
import com.accompany.sms.service.SmsService;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
@@ -127,6 +130,7 @@ public class MyUserDetailsServiceImpl implements MyUserDetailsService {
|
||||
AccountDetails details = (AccountDetails) userDetails;
|
||||
Account account = details.getAccount();
|
||||
String deviceId = deviceInfo.getDeviceId();
|
||||
String client = deviceInfo.getClient();
|
||||
Long uid = account.getUid();
|
||||
Date date = new Date();
|
||||
// 拦截指定账号登录
|
||||
@@ -148,7 +152,12 @@ public class MyUserDetailsServiceImpl implements MyUserDetailsService {
|
||||
checkSmsCodeByUserType(account, smsCode, loginType, deviceInfo.getApp());
|
||||
accountManageService.checkAccountCancel(uid);
|
||||
//更新account信息
|
||||
String newToken = accountService.refreshAndGetNetEaseToken(account);
|
||||
String newToken = null;
|
||||
if (ApplicationConstant.PublicParameters.H5.equals(client)) {
|
||||
newToken = account.getNeteaseToken();
|
||||
} else {
|
||||
newToken = accountService.refreshAndGetNetEaseToken(account);
|
||||
}
|
||||
account.setNeteaseToken(newToken);
|
||||
account.setApp(deviceInfo.getApp());
|
||||
account.setAppVersion(deviceInfo.getAppVersion());
|
||||
|
Reference in New Issue
Block a user