6 Commits 8f2ab5a5c1 ... 76a6c1ea7c

Author SHA1 Message Date
  songfuqiang 76a6c1ea7c Merge branch 'develop' 1 year ago
  songfuqiang 2ba100d3eb 用户模块: 修复抛出设备超过登录数时不返回memberId的问题 1 year ago
  songfuqiang ab86a85678 用户模块: 修复抛出设备超过登录数时不返回memberId的问题 1 year ago
  songfuqiang cf7c7fbd6d 用户模块: 优化用户获取token逻辑 1 year ago
  songfuqiang 757de7f84d 用户模块 清除设备信息打印日志 1 year ago
  songfuqiang a9c2398c83 用户模块 登录逻辑判断修复(memberId赋值异常) 1 year ago

+ 1 - 1
backend-core/src/main/java/cn/kdan/pdf/backend/core/controller/AuthController.java

@@ -109,7 +109,7 @@ public class AuthController {
         if(StringUtils.isEmpty(loginInfoVo.getMessage())){
             return new AppResultMap<>(CommonConstant.SUCCESS,CommonConstant.CODE_SUCCESS,loginInfoVo);
         }else{
-            return new AppResultMap<>(CommonConstant.EXCEPTION_CODE_RUNTIME_ERROR,loginInfoVo.getMessage(),loginInfoVo);
+            return new AppResultMap<>(CommonConstant.EXCEPTION_CODE_TOO_MANY_DEVICE_ERROR,loginInfoVo.getMessage(),loginInfoVo);
         }
 
     }

+ 10 - 10
backend-core/src/main/java/cn/kdan/pdf/backend/core/service/impl/AuthServiceImpl.java

@@ -29,6 +29,7 @@ import com.alibaba.fastjson.TypeReference;
 import constant.CommonConstant;
 import enums.ValidStatusEnum;
 import exception.BackendRuntimeException;
+import exception.TooManyDeviceException;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang3.ObjectUtils;
@@ -331,15 +332,13 @@ public class AuthServiceImpl implements AuthService {
                     memberVo.setTimeZone(member.getTimeZone());
                     memberVo.setAvatarUrl(avatarService.selectAvatarByMemberId(memberId));
                 }else {
-                    if("false".equals(password)){
-                        memberVo.setName(member.getName());
-                        memberVo.setEmail(member.getEmail());
-                        memberVo.setPhone(member.getPhone());
-                        memberVo.setPhoneZone(member.getPhoneZone());
-                        memberVo.setTimeZone(member.getTimeZone());
-                        memberId = member.getId();
-                        memberVo.setAvatarUrl(avatarService.selectAvatarByMemberId(memberId));
-                    }
+                    memberVo.setName(member.getName());
+                    memberVo.setEmail(member.getEmail());
+                    memberVo.setPhone(member.getPhone());
+                    memberVo.setPhoneZone(member.getPhoneZone());
+                    memberVo.setTimeZone(member.getTimeZone());
+                    memberId = member.getId();
+                    memberVo.setAvatarUrl(avatarService.selectAvatarByMemberId(memberId));
                 }
             }else {
                 //如果用户存在将用户id返回,否则其他情况(邮箱登录)全部抛异常:用户未注册
@@ -368,7 +367,7 @@ public class AuthServiceImpl implements AuthService {
         Devices queryDevice;
         try {
             queryDevice = deviceService.selectByMemberId(memberId, loginDevice.getUuid());
-        }catch (BackendRuntimeException e){
+        }catch (TooManyDeviceException e){
             vo.setId(memberId);
             vo.setMessage(e.getMessage());
             return vo;
@@ -538,6 +537,7 @@ public class AuthServiceImpl implements AuthService {
     @Override
     @Transactional(rollbackFor = BackendRuntimeException.class)
     public String clearDevice(String id) {
+        log.info("用户{}清除设备信息:",id);
         Members member = memberService.getById(id);
         //清除设备信息
         deviceService.clearDevice(id);