Преглед изворни кода

优化key 为空时让登录 刷新key

java110 пре 6 година
родитељ
комит
0ed2163b8f

+ 1 - 1
java110-db/src/main/resources/mapper/user/UserServiceDaoImplMapper.xml

@@ -551,7 +551,7 @@
             and ua.status_cd = '0'
         </if>
         <if test="key != null and key != ''">
-            and u.user_id = ua.user_id
+            and u.user_id = ub.user_id
             and ub.spec_cd = '100202061602'
             and ub.value = #{key}
             and ub.status_cd = '0'

+ 5 - 3
service-front/src/main/java/com/java110/front/smo/ownerLogin/impl/OwnerAppLoginSMOImpl.java

@@ -231,9 +231,11 @@ public class OwnerAppLoginSMOImpl extends AbstractFrontServiceSMO implements IOw
         userDto.setUserId(ownerAppUserDtos.get(0).getUserId());
         UserDto tmpUserDto = super.getForApi(pd, userDto, ServiceCodeConstant.QUERY_USER_SECRET, UserDto.class);
 
-//        if(StringUtil.isEmpty(tmpUserDto.getKey())){
-//            tmpUserDto = super.postForApi(pd, tmpUserDto, ServiceCodeConstant.SERVICE_CODE_USER_LOGIN, UserDto.class);
-//        }
+        if(StringUtil.isEmpty(tmpUserDto.getKey())){
+            String code = UUID.randomUUID().toString();
+            CommonCache.setValue(code, openId, expireTime);
+            return ResultVo.redirectPage(errorUrl + "?code=" + code);
+        }
         redirectUrl = redirectUrl + (redirectUrl.indexOf("?") > 0 ? "&key=" + tmpUserDto.getKey() : "?key=" + tmpUserDto.getKey());
         return ResultVo.redirectPage(redirectUrl);