Browse Source

用户不存在提示语

lyhzzz 2 years ago
parent
commit
1db0c7b12e
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/main/java/com/fdkankan/ucenter/service/impl/AppService.java

+ 3 - 0
src/main/java/com/fdkankan/ucenter/service/impl/AppService.java

@@ -136,6 +136,9 @@ public class AppService {
         String redisValue = "";
         if(userId!= null){
             User user = userService.getById(userId);
+            if(user == null){
+                throw new BusinessException(LoginConstant.FAILURE_CODE_3015, LoginConstant.FAILURE_MSG_3015);
+            }
             redisValue = JSONObject.toJSONString(user);
             if(!stripeService.checkUserStripePay(user.getId(),user.getUserName())){
                 throw new BusinessException(LoginConstant.FAILURE_CODE_3016, LoginConstant.FAILURE_MSG_3016);