ZHIHAO HU 4 лет назад
Родитель
Сommit
9acb7be35b

+ 5 - 1
src/main/java/platform/common/util/AlibabaSMSUtil.java

@@ -56,7 +56,11 @@ public class AlibabaSMSUtil {
 
     public static void sendSMS(String phone, String templateCode, String signName, String templateParam) throws ClientException, InterruptedException {
         //test aliyun环境不发送短信
-        if (!Constant.Environment.PROD_TEST.equals(profiles) && !Constant.Environment.TEST.equals(profiles)) {
+        if (
+                !Constant.Environment.PROD_TEST.equals(profiles)
+                        && !Constant.Environment.TEST.equals(profiles)
+                        /*&& !Constant.Environment.ALIYUN.equals(profiles)*/
+        ) {
             SendSmsResponse response = sendSMSMessage(phone, templateCode, signName, templateParam);
             System.out.println("短信接口返回的数据----------------");
             System.out.println("Code=" + response.getCode());

+ 18 - 15
src/main/java/platform/modules/sys/service/ActivityRegistrationService.java

@@ -271,22 +271,25 @@ public class ActivityRegistrationService extends BaseService<ActivityRegistratio
      */
     public List<ActivityRegistration> getCurrRegUsers(String activity_id) {
 
-        Integer userType = ShiroUtils.getUserType();
-        String relationId = "";
-        if (Objects.equals(Constant.UserType.GOVERNMENT, userType)) {
-            relationId = "0";
-        } else if (Objects.equals(Constant.UserType.BUILD, userType)) {
-            relationId = ShiroUtils.getBuildId().toString();
-        } else if (Objects.equals(Constant.UserType.STREET, userType)) {
-            relationId = ShiroUtils.getStreetId().toString();
-        } else if (Objects.equals(Constant.UserType.COMPANY, userType)) {
-            relationId = ShiroUtils.getCompanyId().toString();
-        } else if (Objects.equals(Constant.UserType.PERSONAL, userType)) {
-            relationId = ShiroUtils.getUserId().toString();
-        } else if (Objects.equals(Constant.UserType.WECHAT, userType)) {
-            relationId = ShiroUtils.getUserId().toString();
+        if(ShiroUtils.isLogin()){
+            Integer userType = ShiroUtils.getUserType();
+            String relationId = "";
+            if (Objects.equals(Constant.UserType.GOVERNMENT, userType)) {
+                relationId = "0";
+            } else if (Objects.equals(Constant.UserType.BUILD, userType)) {
+                relationId = ShiroUtils.getBuildId().toString();
+            } else if (Objects.equals(Constant.UserType.STREET, userType)) {
+                relationId = ShiroUtils.getStreetId().toString();
+            } else if (Objects.equals(Constant.UserType.COMPANY, userType)) {
+                relationId = ShiroUtils.getCompanyId().toString();
+            } else if (Objects.equals(Constant.UserType.PERSONAL, userType)) {
+                relationId = ShiroUtils.getUserId().toString();
+            } else if (Objects.equals(Constant.UserType.WECHAT, userType)) {
+                relationId = ShiroUtils.getUserId().toString();
+            }
+            return activityRegistrationDao.findByRelationIdAndType(userType.toString(), relationId, activity_id);
         }
-        return activityRegistrationDao.findByRelationIdAndType(userType.toString(), relationId, activity_id);
+        return new ArrayList<>();
     }
 
     /**