From 4ddf8b517a730a7cf5d60ff1755f3e38b98fda01 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期五, 20 十二月 2024 15:03:46 +0800
Subject: [PATCH] 合并代码

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java           |    4 ++++
 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java
index 6adc13f..cf8db83 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java
@@ -201,7 +201,7 @@
 		//校验验证码获取评率(1分钟5次)
 		String key = smsCode.getType() + "&" + smsCode.getPhone();
 		Map<String, Object> cacheMap = redisService.getCacheMap(key);
-		if(null != cacheMap){
+		if(null != cacheMap && cacheMap.size() > 0){
 			Integer number = Integer.valueOf(cacheMap.get("number").toString()) + 1;
 			Long startTime = Long.valueOf(cacheMap.get("startTime").toString());
 			if(number > 5 && (System.currentTimeMillis() - startTime) < 60000){
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
index 872988e..d958544 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
@@ -25,6 +25,7 @@
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -201,6 +202,9 @@
         R<List<AppUserShop>> r = appUserClient.getAppUserShop(SecurityUtils.getUserId());
         if (R.isSuccess(r)){
             List<AppUserShop> appUserShopList = r.getData();
+            if (CollectionUtils.isEmpty(appUserShopList)){
+                return R.ok(new ArrayList<>());
+            }
             List<Integer> shopIds = appUserShopList.stream().map(AppUserShop::getShopId).collect(Collectors.toList());
             List<Shop> shopList = shopService.listByIds(shopIds);
             return R.ok(shopList);

--
Gitblit v1.7.1