@Override publicvoidonExpiredSessionDetected(SessionInformationExpiredEvent event)throws IOException { event.getResponse().sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, JSONObject.toJSONString(MessageBody.failure(405,"not login or login has been expired"))); } }
if (!getSecureObjectClass().isAssignableFrom(object.getClass())) { thrownewIllegalArgumentException( "Security invocation attempted for object " + object.getClass().getName() + " but AbstractSecurityInterceptor only configured to support secure objects of type: " + getSecureObjectClass()); }
if (attributes == null || attributes.isEmpty()) { if (rejectPublicInvocations) { thrownewIllegalArgumentException( "Secure object invocation " + object + " was denied as public invocations are not allowed via this interceptor. " + "This indicates a configuration error because the " + "rejectPublicInvocations property is set to 'true'"); }
if (debug) { logger.debug("Public object - authentication not attempted"); }
if (SecurityContextHolder.getContext().getAuthentication() == null) { credentialsNotFound(messages.getMessage( "AbstractSecurityInterceptor.authenticationNotFound", "An Authentication object was not found in the SecurityContext"), object, attributes); }
if (debug) { logger.debug("Authorization successful"); }
if (publishAuthorizationSuccess) { publishEvent(newAuthorizedEvent(object, attributes, authenticated)); }
// Attempt to run as a different user AuthenticationrunAs=this.runAsManager.buildRunAs(authenticated, object, attributes);
if (runAs == null) { if (debug) { logger.debug("RunAsManager did not change Authentication object"); }
// no further work post-invocation returnnewInterceptorStatusToken(SecurityContextHolder.getContext(), false, attributes, object); } else { if (debug) { logger.debug("Switching to RunAs Authentication: " + runAs); }
sendStartAuthentication( request, response, chain, newInsufficientAuthenticationException( "Full authentication is required to access this resource")); } else { logger.debug( "Access is denied (user is not anonymous); delegating to AccessDeniedHandler", exception);
if (forceHttps && "http".equals(request.getScheme())) { // First redirect the current request to HTTPS. // When that request is received, the forward to the login page will be // used. redirectUrl = buildHttpsRedirectUrlForRequest(request); }
if (redirectUrl == null) { StringloginForm= determineUrlToUseForThisRequest(request, response, authException);
if (logger.isDebugEnabled()) { logger.debug("Server side forward to: " + loginForm); }
let arr=[1,2,234,'sdf',-2]; arr.includes(2);// 结果true,返回布尔值 arr.includes(20);// 结果:false,返回布尔值 arr.includes(2,3)//结果:false,返回布尔值
arr.keys()
keys,对数组索引的遍历
1 2 3 4
let arr=[1,2,234,'sdf',-2]; for(let a of arr.keys()){ console.log(a) }//结果:0,1,2,3,4 遍历了数组arr的索引
arr.values()
values, 对数组项的遍历
1 2 3 4
let arr=[1,2,234,'sdf',-2]; for(let a of arr.values()){ console.log(a) }//结果:1,2,234,sdf,-2 遍历了数组arr的值
arr.entries()
entries,对数组键值对的遍历。
1 2 3 4 5 6 7
let arr=['w','b']; for(let a of arr.entries()){ console.log(a) }//结果:[0,w],[1,b] for(let [i,v] of arr.entries()){ console.log(i,v) }//结果:0 w,1 b
arr.fill()
fill方法改变原数组,当第三个参数大于数组长度时候,以最后一位为结束位置。
1 2 3 4
let arr=['w','b']; arr.fill('i')//结果:['i','i'],改变原数组 arr.fill('o',1)//结果:['i','o']改变原数组,第二个参数表示填充起始位置 newArray(3).fill('k').fill('r',1,2)//结果:['k','r','k'],第三个数组表示填充的结束位置