Переглянути джерело

Merge branch 'dev_2.0.0' of http://git.qmth.com.cn/luoshi/stmms-ft.git into dev_2.0.0

xiatian 15 годин тому
батько
коміт
847ee56592

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

@@ -90,7 +90,7 @@ public class ApiInterceptor extends HandlerInterceptorAdapter {
                     if (!school.isEnable()) {
                         throw ApiException.USER_DISABLED;
                     }
-                    if (!matchRole(authConfig, Role.SCHOOL_DEV)) {
+                    if (authConfig != null && authConfig.value().length > 0&& !matchRole(authConfig, Role.SCHOOL_DEV)) {
                         throw ApiException.USER_ROLE_INVALID;
                     }
                     return buildApiUser(request, response, school);
@@ -109,7 +109,7 @@ public class ApiInterceptor extends HandlerInterceptorAdapter {
                     if (!user.isEnable()) {
                         throw ApiException.USER_DISABLED;
                     }
-                    if (!matchRole(authConfig, user.getRole())) {
+                    if (authConfig != null && authConfig.value().length > 0 && !matchRole(authConfig, user.getRole())) {
                         throw ApiException.USER_ROLE_INVALID;
                     }
                     return buildApiUser(request, response, user);
@@ -129,7 +129,7 @@ public class ApiInterceptor extends HandlerInterceptorAdapter {
                 if (!user.isEnable()) {
                     throw ApiException.USER_DISABLED;
                 }
-                if (!matchRole(authConfig, user.getRole())) {
+                if (authConfig != null && authConfig.value().length > 0&& !matchRole(authConfig, user.getRole())) {
                     throw ApiException.USER_ROLE_INVALID;
                 }
                 return buildApiUser(request, response, user);