|
@@ -1,5 +1,6 @@
|
|
|
package com.qmth.distributed.print.auth;
|
|
|
|
|
|
+import com.qmth.boot.core.enums.Platform;
|
|
|
import com.qmth.boot.core.security.model.AccessEntity;
|
|
|
import com.qmth.boot.core.security.service.AuthorizationService;
|
|
|
import com.qmth.boot.tools.signature.SignatureType;
|
|
@@ -52,6 +53,16 @@ public class DistributedPrintAuthenticationService implements AuthorizationServi
|
|
|
log.warn("Authorization faile: session has expired, expire time=" + tbSession.getExpireTime());
|
|
|
throw ExceptionResultEnum.NOT_LOGIN.exception();
|
|
|
}
|
|
|
+ Platform platform = ServletUtil.getRequestPlatform();
|
|
|
+ String deviceId = ServletUtil.getRequestDeviceId();
|
|
|
+ if (!tbSession.getPlatform().equalsIgnoreCase(platform.name())) {
|
|
|
+ log.warn("Authorization faile: platform invalid, session platform is " + tbSession.getPlatform());
|
|
|
+ throw ExceptionResultEnum.AUTHORIZATION_ERROR.exception();
|
|
|
+ }
|
|
|
+ if (!tbSession.getDeviceId().equalsIgnoreCase(deviceId)) {
|
|
|
+ log.warn("Authorization faile: deviceId invalid, session deviceId is " + tbSession.getDeviceId());
|
|
|
+ throw ExceptionResultEnum.AUTHORIZATION_ERROR.exception();
|
|
|
+ }
|
|
|
List<String> privilegeUrl = cacheService.privilegeUrlCache(PrivilegePropertyEnum.NO_AUTH);
|
|
|
//无需鉴权的url
|
|
|
int noAuthCount = Objects.nonNull(privilegeUrl) ? (int) privilegeUrl.stream().filter(s -> s.equalsIgnoreCase(path)).count() : 0;
|