From e28b43272012f9d5db66c195f8fcd27febfb0055 Mon Sep 17 00:00:00 2001 From: hechanggeng Date: Fri, 12 Jan 2024 00:38:34 +0800 Subject: [PATCH] 1.fix NPE issue --- .../main/java/com/luoo/user/controller/UserController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luoo_user/src/main/java/com/luoo/user/controller/UserController.java b/luoo_user/src/main/java/com/luoo/user/controller/UserController.java index 853c592..268c794 100644 --- a/luoo_user/src/main/java/com/luoo/user/controller/UserController.java +++ b/luoo_user/src/main/java/com/luoo/user/controller/UserController.java @@ -83,7 +83,7 @@ public class UserController { public ResultVO appLogin(@PathVariable String mobile,@PathVariable String checkcode){ // 得到缓存中的验证码 String checkcodeRedis = (String)redisTemplate.opsForValue().get("checkcode_"+mobile); - if (checkcodeRedis.isEmpty()){ + if (null==checkcodeRedis||checkcodeRedis.isEmpty()){ return new ResultVO(false,StatusCode.ERROR,"请先获取手机验证码"); } if (!checkcodeRedis.equals(checkcode)) { @@ -93,7 +93,7 @@ public class UserController { return ResultVO.success(userVO); } - @ApiOperation(value="3.游客模式返回token",notes="token中的subject和roles均为tourist") + @ApiOperation(value="3.游客登录返回token",notes="token中的subject和roles均为tourist") @RequestMapping(value = "/touristLogin",method = RequestMethod.GET) public ResultVO touristLogin(){ UserVO userVO=userService.touristLogin();