From 23b55dc567bcf8a453e4b88df2f5f5b664f9e9f1 Mon Sep 17 00:00:00 2001
From: DESKTOP-71BH0QO\L、ming <172680469@qq.com>
Date: 星期三, 24 三月 2021 15:46:49 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/controller/BaseController.java |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/controller/BaseController.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/controller/BaseController.java
index 45d48f1..8639fc0 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/controller/BaseController.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/controller/BaseController.java
@@ -4,6 +4,7 @@
 import com.panzhihua.common.constants.Constants;
 import com.panzhihua.common.constants.TokenConstant;
 import com.panzhihua.common.constants.UserConstants;
+import com.panzhihua.common.exceptions.ServiceException;
 import com.panzhihua.common.exceptions.UnAuthenticationException;
 import com.panzhihua.common.model.vos.LoginUserInfoVO;
 import com.panzhihua.common.utlis.AES;
@@ -49,6 +50,9 @@
     public Long getCommunityId(){
         LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
         Long communityId = loginUserInfo.getCommunityId();
+        if (null==communityId||0==communityId) {
+            throw  new ServiceException("用户未绑定社区");
+        }
         return communityId;
     }
 
@@ -59,6 +63,9 @@
     public Long getAreaId(){
         LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
         Long areaId = loginUserInfo.getAreaId();
+        if (null==areaId||0==areaId) {
+            throw  new ServiceException("用户未绑定社区");
+        }
         return areaId;
     }
 

--
Gitblit v1.7.1