Răsfoiți Sursa

修复生成任务保存随机数量;新增扫描端登陆错误提示

yin 10 luni în urmă
părinte
comite
7bb3ba3edb

+ 3 - 1
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/mark/service/Impl/MarkCronService.java

@@ -294,11 +294,13 @@ public class MarkCronService {
                 if (!libraryList.isEmpty()) {
                     count += libraryList.size();
                     // 任务乱序
+                    int shuffleCount =(group.getDoubleRate() != null && group.getDoubleRate() > 0) ? 40:20;
+
                     List<MarkLibrary> list = new ArrayList<>();
                     List<MarkLibrary> saveList = new ArrayList<>();
                     for (MarkLibrary l : libraryList) {
                         list.add(l);
-                        if (list.size() >= 20) {
+                        if (list.size() >= shuffleCount) {
                             Collections.shuffle(list);
                             saveList.addAll(list);
                             list = new ArrayList<>();

+ 2 - 0
stmms-web/src/main/java/cn/com/qmth/stmms/api/exception/ApiException.java

@@ -27,6 +27,8 @@ public class ApiException extends RuntimeException {
 
     public static final ApiException SIGNATURE_INVALID = new ApiException(401, "signature invalid");
 
+    public static final ApiException PASSWORD_ERROR = new ApiException(401, "user password error");
+
     public static final ApiException USER_DISABLED = new ApiException(401, "user disabled");
 
     public static final ApiException USER_ROLE_INVALID = new ApiException(401, "user's role invalid");

+ 4 - 1
stmms-web/src/main/java/cn/com/qmth/stmms/api/interceptor/ApiInterceptor.java

@@ -108,9 +108,12 @@ public class ApiInterceptor extends HandlerInterceptorAdapter {
             // 再尝试按简单模式解析
             else if ((simple = authorizationService.buildAuthInfo(request)) != null) {
                 User user = userService.findByLoginName(simple.getLoginname());
-                if (user == null || !EncryptUtils.md5(simple.getPassword()).equals(user.getPassword())) {
+                if (user == null) {
                     throw ApiException.SIGNATURE_INVALID;
                 }
+                if( !EncryptUtils.md5(simple.getPassword()).equals(user.getPassword())){
+                    throw ApiException.PASSWORD_ERROR;
+                }
                 if (!user.isEnable()) {
                     throw ApiException.USER_DISABLED;
                 }