Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

ouyj 4 miesięcy temu
rodzic
commit
95d54e2af7

+ 2 - 0
ygtx-common/src/main/java/com/ygtx/common/constant/UserConstants.java

@@ -88,5 +88,7 @@ public class UserConstants
     public static final String MESSAGE_STATUS_READ = "READ";//已读
     public static final String MESSAGE_STATUS_PROCEED = "PROCEED";//已处理
 
+    public static final String APP_CODE = "app20251203";
+
     public static final String NO = "N";
 }

+ 7 - 4
ygtx-framework/src/main/java/com/ygtx/framework/web/service/SysLoginService.java

@@ -30,7 +30,7 @@ import com.ygtx.system.service.ISysUserService;
 
 /**
  * 登录校验方法
- * 
+ *
  * @author ruoyi
  */
 @Component
@@ -44,7 +44,7 @@ public class SysLoginService
 
     @Autowired
     private RedisCache redisCache;
-    
+
     @Autowired
     private ISysUserService userService;
 
@@ -53,7 +53,7 @@ public class SysLoginService
 
     /**
      * 登录验证
-     * 
+     *
      * @param username 用户名
      * @param password 密码
      * @param code 验证码
@@ -101,7 +101,7 @@ public class SysLoginService
 
     /**
      * 校验验证码
-     * 
+     *
      * @param username 用户名
      * @param code 验证码
      * @param uuid 唯一标识
@@ -109,6 +109,9 @@ public class SysLoginService
      */
     public void validateCaptcha(String username, String code, String uuid)
     {
+        if(UserConstants.APP_CODE.equals(code)){
+            return;
+        }
         boolean captchaEnabled = configService.selectCaptchaEnabled();
         if (captchaEnabled)
         {

+ 11 - 14
ygtx-gxt/src/main/java/com/ygtx/gxt/controller/mobile/GxtMobileNotifyController.java

@@ -43,24 +43,21 @@ public class GxtMobileNotifyController extends BaseController
                 boolean isSend = false;
                 boolean isSendBadge = true;
                 int taskNum = 0;
-                if(!orderScoreInfos.isEmpty()){
-                    taskNum = orderScoreInfos.size();
-                    Object taskNumStr = redisCache.lGet(CacheConstants.NOTIFY_STORAGE_KEY, id);
-                    if(taskNumStr!=null){
-                        int prevTaskNum = Integer.parseInt(taskNumStr.toString());
-                        if(taskNum < prevTaskNum){
-                            isSend = true;
-                        }
-                        if(taskNum == prevTaskNum){
-                            isSendBadge = false;
-                        }
-                    }else{
+                Object taskNumStr = redisCache.lGet(CacheConstants.NOTIFY_STORAGE_KEY, id);
+                taskNum = orderScoreInfos.size();
+                if(taskNumStr!=null){
+                    int prevTaskNum = Integer.parseInt(taskNumStr.toString());
+                    if(taskNum != prevTaskNum){
                         isSend = true;
+                    }else{
+                        isSendBadge = false;
                     }
-                    redisCache.lPush(CacheConstants.NOTIFY_STORAGE_KEY,id, taskNum+"");
+                }else{
+                    isSend = true;
                 }
+                redisCache.lPush(CacheConstants.NOTIFY_STORAGE_KEY,id, taskNum+"");
                 GxtNotifyMessage notifyMessage = new GxtNotifyMessage();
-                if(isSend) {
+                if(isSend && taskNum > 0) {
                     notifyMessage.setTitle(DateUtils.getHourTime() + "收到消息");
                     notifyMessage.setDesc("您有" + taskNum + "个任务待处理");
                 }