{"id":3728,"date":"2018-12-07T18:55:54","date_gmt":"2018-12-07T10:55:54","guid":{"rendered":"http:\/\/switch.linesno.com\/?p=3728"},"modified":"2018-12-07T18:55:54","modified_gmt":"2018-12-07T10:55:54","slug":"%e8%a7%a3%e5%86%b3cas%e5%86%85%e5%a4%96%e7%bd%91%e5%8f%8cip%e8%ae%bf%e9%97%ae%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/switch.linesno.com\/?p=3728","title":{"rendered":"\u89e3\u51b3CAS\u5185\u5916\u7f51\u53ccIP\u8bbf\u95ee\u7684\u95ee\u9898"},"content":{"rendered":"<p>\u6700\u8fd1\u9879\u76ee\u5206\u7ed9\u6211\u4e00\u4e2a\u9700\u6c42\u89e3\u51b3CAS\u8ba4\u8bc1\u767b\u9646\u7684\u5185\u5916\u7f51\u53ccIP\u8bbf\u95ee\u7684\u95ee\u9898\uff0c\u5f53\u4f7f\u7528\u901a\u7528\u7684CAS\u7edf\u4e00\u8ba4\u8bc1\u670d\u52a1\u65f6\uff0c\u7531\u4e8eWEB\u5e94\u7528\u5de5\u7a0b\u4e2dweb.xml\u914d\u7f6e\u7684CAS\u5730\u5740\u662f\u56fa\u5b9a\u7684\uff0c\u800c\u4e0d\u662f\u4e00\u4e2a\u52a8\u6001\u7684\u5730\u5740\uff0c\u5f53\u5c06WEB\u5e94\u7528\u670d\u52a1\u5668\u4f8b\u5982TOMCAT\u7aef\u53e3\u6620\u5c04\u5916\u7f51\u540e\uff0c\u5728\u8bbf\u95ee\u5e94\u7528\u65f6\u4f1a\u81ea\u52a8\u6839\u636e\u5728web.xml\u6587\u4ef6\u4e2d\u53bb\u914d\u7f6e\u5bf9\u5e94\u7684CAS\u5730\u5740\uff0c\u800c\u6b64\u65f6\u7684\u5730\u5740\u53ea\u80fd\u662f\u5185\u7f51\u4f7f\u7528\uff0c\u5916\u7f51\u81ea\u7136\u65e0\u6cd5\u627e\u5230\uff0c\u5219\u65e0\u6cd5\u767b\u9646\uff0c\u800c\u7531\u4e8e\u9879\u76ee\u7684\u672c\u8eab\u9700\u8981\uff0c\u5fc5\u987b\u8981\u540c\u65f6\u5185\u5916\u7f51\u90fd\u80fd\u8bbf\u95ee\uff0c\u7531\u6b64\u770b\u4e86\u4e00\u5468\u6e90\u7801\u540e\uff0c\u63d0\u4f9b\u4ee5\u4e0b\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<p>\u4f9b\u5de5\u5177\u7c7b<\/p>\n<p>public class HttpConnectionUtil {<br \/>\n\/\/\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\u4fe1\u606f<br \/>\nstatic Properties prop = new Properties();<br \/>\nstatic{<br \/>\nInputStream inStream = HttpConnectionUtil.class.getClassLoader().getResourceAsStream(&#8220;application.properties&#8221;);<br \/>\ntry {<br \/>\nprop.load(inStream);<br \/>\n} catch (IOException e) {<br \/>\ne.printStackTrace();<br \/>\n}<br \/>\n}<\/p>\n<p>\/**<br \/>\n*<br \/>\n* @param name<br \/>\n* @return<br \/>\n*\/<br \/>\n\/\/\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u901a\u8fc7\u952e\u53d6\u503c<br \/>\npublic static String getByName(String name){<br \/>\nreturn prop.getProperty(name);<br \/>\n}<br \/>\n\/\/\u5224\u65ad\u662f\u5185\u7f51\u73af\u5883\u8fd8\u662f\u5916\u7f51\u73af\u5883<br \/>\npublic static boolean isInner(String clientIP) {<br \/>\nString reg = &#8220;(10|172|192|127)\\\\.([0-1][0-9]{0,2}|[2][0-5]{0,2}|[3-9][0-9]{0,1})\\\\.([0-1][0-9]{0,2}|[2][0-5]{0,2}|[3-9][0-9]{0,1})\\\\.([0-1][0-9]{0,2}|[2][0-5]{0,2}|[3-9][0-9]{0,1})&#8221;;<br \/>\nPattern p = Pattern.compile(reg);<br \/>\nMatcher matcher = p.matcher(clientIP);<br \/>\nreturn matcher.find();<br \/>\n}<br \/>\n}<\/p>\n<p>\u6e90\u7801\u89e3\u8bfb\uff1a<br \/>\n\u672c\u9879\u76ee\u662fcas\u548cshiro\u7684\u6574\u5408\uff0ccas\u8ba4\u8bc1\u767b\u9646\u52a0\u5165\u5230shiro\u7684\u8fc7\u6ee4\u8fde\u91cc\u9762\uff1a<br \/>\n\u5728web.xml\u91cc\u9762\u914d\u7f6e\uff1a<\/p>\n<p>&lt;!&#8211; \u5355\u70b9\u767b\u5f55end &#8211;&gt;<br \/>\n&lt;filter&gt;<br \/>\n&lt;filter-name&gt;shiroFilter&lt;\/filter-name&gt;<br \/>\n&lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;\/filter-class&gt;<br \/>\n&lt;init-param&gt;<br \/>\n&lt;param-name&gt;targetFilterLifecycle&lt;\/param-name&gt;<br \/>\n&lt;param-value&gt;true&lt;\/param-value&gt;<br \/>\n&lt;\/init-param&gt;<br \/>\n&lt;!&#8211; \u8bbe\u7f6espring\u5bb9\u5668filter\u7684bean id\uff0c\u5982\u679c\u4e0d\u8bbe\u7f6e\u5219\u627e\u4e0efilter-name\u4e00\u81f4\u7684bean&#8211;&gt;<br \/>\n&lt;init-param&gt;<br \/>\n&lt;param-name&gt;targetBeanName&lt;\/param-name&gt;<br \/>\n&lt;param-value&gt;shiroFilter&lt;\/param-value&gt;<br \/>\n&lt;\/init-param&gt;<br \/>\n&lt;\/filter&gt;<br \/>\n&lt;filter-mapping&gt;<br \/>\n&lt;filter-name&gt;shiroFilter&lt;\/filter-name&gt;<br \/>\n&lt;url-pattern&gt;\/*&lt;\/url-pattern&gt;<br \/>\n&lt;\/filter-mapping&gt;<\/p>\n<p>\u7136\u540e\u8fc7\u6ee4\u94fe\u5728spring\u5bb9\u5668\u91cc\u9762\u627eid\u4e3ashiroFilter\u7684bean\u5de5\u5382<\/p>\n<p>&lt;bean id=&#8221;casFilter&#8221; class=&#8221;org.apache.shiro.cas.CasFilter&#8221;&gt;<br \/>\n&lt;!&#8211; \u914d\u7f6e\u9a8c\u8bc1\u9519\u8bef\u65f6\u7684\u5931\u8d25\u9875\u9762 &#8211;&gt;<br \/>\n&lt;!&#8211;&lt;property name=&#8221;failureUrl&#8221; value=&#8221;\/error.jsp&#8221;\/&gt; &#8211;&gt;<br \/>\n&lt;!&#8211; &lt;property name=&#8221;failureUrl&#8221; value=&#8221;\/casFailure.jsp&#8221; \/&gt; &#8211;&gt;<br \/>\n&lt;!&#8211; &lt;property name=&#8221;successUrl&#8221; value=&#8221;\/front3\/index.html&#8221;\/&gt; &#8211;&gt;<br \/>\n&lt;property name=&#8221;failureUrl&#8221; value=&#8221;${common_in.ip}\/disrec&#8221; \/&gt;<br \/>\n&lt;\/bean&gt;<br \/>\n&lt;!&#8211; &lt;bean id=&#8221;casRealm&#8221; class=&#8221;com.zonekey.disrec.service.auth.ShiroDbRealm&#8221;&gt;<br \/>\n&lt;property name=&#8221;cachingEnabled&#8221; value=&#8221;true&#8221; \/&gt;<br \/>\n&lt;property name=&#8221;authenticationCachingEnabled&#8221; value=&#8221;true&#8221; \/&gt;<br \/>\n&lt;property name=&#8221;authenticationCacheName&#8221; value=&#8221;authenticationCache&#8221; \/&gt;<br \/>\n&lt;property name=&#8221;authorizationCachingEnabled&#8221; value=&#8221;true&#8221; \/&gt;<br \/>\n&lt;property name=&#8221;authorizationCacheName&#8221; value=&#8221;authorizationCache&#8221; \/&gt;<\/p>\n<p>&lt;property name=&#8221;casServerUrlPrefix&#8221; value=${login.ip}\/&gt;<br \/>\n\u5ba2\u6237\u7aef\u7684\u56de\u8c03\u5730\u5740\u8bbe\u7f6e\uff0c\u5fc5\u987b\u548c\u4e0b\u9762\u7684shiro-cas\u8fc7\u6ee4\u5668\u62e6\u622a\u7684\u5730\u5740\u4e00\u81f4<br \/>\n&lt;property name=&#8221;casService&#8221; value=&#8221;${common.ip}\/disrec\/shiro-cas&#8221;\/&gt;<br \/>\n&lt;\/bean&gt; &#8211;&gt;<br \/>\n&lt;bean id=&#8221;casRealm&#8221; class=&#8221;com.zonekey.disrec.service.auth.ShiroDbRealm&#8221;&gt;<br \/>\n&lt;property name=&#8221;cachingEnabled&#8221; value=&#8221;true&#8221; \/&gt;<br \/>\n&lt;property name=&#8221;authenticationCachingEnabled&#8221; value=&#8221;true&#8221; \/&gt;<br \/>\n&lt;property name=&#8221;authenticationCacheName&#8221; value=&#8221;authenticationCache&#8221; \/&gt;<br \/>\n&lt;property name=&#8221;authorizationCachingEnabled&#8221; value=&#8221;true&#8221; \/&gt;<br \/>\n&lt;property name=&#8221;authorizationCacheName&#8221; value=&#8221;authorizationCache&#8221; \/&gt;<br \/>\n&lt;property name=&#8221;casServerUrlPrefix&#8221; value=&#8221;${login_in.ip}&#8221; \/&gt;<br \/>\n&lt;!&#8211; \u8be5\u5730\u5740\u4e3aclient1 \u7684\u8bbf\u95ee\u5730\u5740+ \u4e0b\u9762\u914d\u7f6e\u7684cas filter &#8211;&gt;<br \/>\n&lt;property name=&#8221;casService&#8221; value=&#8221;${common_in.ip}\/disrec\/shiro-cas&#8221; \/&gt;<br \/>\n&lt;\/bean&gt;<\/p>\n<p>&lt;bean id=&#8221;securityManager&#8221; class=&#8221;org.apache.shiro.web.mgt.DefaultWebSecurityManager&#8221;&gt;<br \/>\n&lt;property name=&#8221;realm&#8221; ref=&#8221;casRealm&#8221;\/&gt;<br \/>\n&lt;property name=&#8221;rememberMeManager&#8221; ref=&#8221;rememberMeManager&#8221; \/&gt;<br \/>\n&lt;property name=&#8221;subjectFactory&#8221; ref=&#8221;casSubjectFactory&#8221;\/&gt;<br \/>\n&lt;\/bean&gt;<\/p>\n<p>&lt;!&#8211; rememberMe\u7ba1\u7406\u5668 \u5982\u9700\u8981\u8bb0\u4f4f\u529f\u80fd \u53ef\u5220\u6389\u76f8\u5173\u914d\u7f6e&lt;span style=&#8221;white-space:pre&#8221;&gt; &lt;\/span&gt;<br \/>\nrememberMe cookie\u52a0\u5bc6\u7684\u5bc6\u94a5 \u5efa\u8bae\u6bcf\u4e2a\u9879\u76ee\u90fd\u4e0d\u4e00\u6837 \u9ed8\u8ba4AES\u7b97\u6cd5 \u5bc6\u94a5\u957f\u5ea6\uff08128 256 512 \u4f4d\uff09 &#8211;&gt;<br \/>\n&lt;bean id=&#8221;rememberMeManager&#8221; class=&#8221;org.apache.shiro.web.mgt.CookieRememberMeManager&#8221;&gt;<br \/>\n&lt;property name=&#8221;cipherKey&#8221;<br \/>\nvalue=&#8221;#{T(org.apache.shiro.codec.Base64).decode(&#8216;4AvVhmFLUs0KTA3Kprsdag==&#8217;)}&#8221; \/&gt;<br \/>\n&lt;property name=&#8221;cookie&#8221; ref=&#8221;rememberMeCookie&#8221; \/&gt;<br \/>\n&lt;\/bean&gt;<\/p>\n<p>&lt;!&#8211; \u4f1a\u8bddID\u751f\u6210\u5668 &#8211;&gt;<br \/>\n&lt;bean id=&#8221;sessionIdGenerator&#8221; class=&#8221;org.apache.shiro.session.mgt.eis.JavaUuidSessionIdGenerator&#8221; \/&gt;<\/p>\n<p>&lt;!&#8211; \u4f1a\u8bddCookie\u6a21\u677f &#8211;&gt;<br \/>\n&lt;bean id=&#8221;sessionIdCookie&#8221; class=&#8221;org.apache.shiro.web.servlet.SimpleCookie&#8221;&gt;<br \/>\n&lt;constructor-arg value=&#8221;sid&#8221; \/&gt;<br \/>\n&lt;property name=&#8221;httpOnly&#8221; value=&#8221;true&#8221; \/&gt;<br \/>\n&lt;property name=&#8221;maxAge&#8221; value=&#8221;-1&#8243; \/&gt;<br \/>\n&lt;\/bean&gt;<\/p>\n<p>&lt;bean id=&#8221;rememberMeCookie&#8221; class=&#8221;org.apache.shiro.web.servlet.SimpleCookie&#8221;&gt;<br \/>\n&lt;constructor-arg value=&#8221;rememberMe&#8221; \/&gt;<br \/>\n&lt;property name=&#8221;httpOnly&#8221; value=&#8221;true&#8221; \/&gt;<br \/>\n&lt;property name=&#8221;maxAge&#8221; value=&#8221;2592000&#8243; \/&gt;&lt;!&#8211; 30\u5929 &#8211;&gt;<br \/>\n&lt;\/bean&gt;<\/p>\n<p>&lt;!&#8211; \u4f1a\u8bddDAO &#8211;&gt;<br \/>\n&lt;bean id=&#8221;sessionDAO&#8221; class=&#8221;org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO&#8221;&gt;<br \/>\n&lt;property name=&#8221;activeSessionsCacheName&#8221; value=&#8221;shiro-activeSessionCache&#8221; \/&gt;<br \/>\n&lt;property name=&#8221;sessionIdGenerator&#8221; ref=&#8221;sessionIdGenerator&#8221; \/&gt;<br \/>\n&lt;\/bean&gt;<\/p>\n<p>&lt;bean id=&#8221;logout&#8221; class=&#8221;org.apache.shiro.web.filter.authc.LogoutFilter&#8221;&gt;<br \/>\n&lt;property name=&#8221;redirectUrl&#8221; value=&#8221;${login_in.ip}\/cas\/logout?service=${common_in.ip}\/disrec\/shiro-cas\/&#8221; \/&gt;<br \/>\n&lt;\/bean&gt;<\/p>\n<p>&lt;!&#8211; \u5982\u679c\u8981\u5b9e\u73b0cas\u7684remember me\u7684\u529f\u80fd\uff0c\u9700\u8981\u7528\u5230\u4e0b\u9762\u8fd9\u4e2abean\uff0c\u5e76\u8bbe\u7f6e\u5230securityManager\u7684subjectFactory\u4e2d &#8211;&gt;<br \/>\n&lt;bean id=&#8221;casSubjectFactory&#8221; class=&#8221;org.apache.shiro.cas.CasSubjectFactory&#8221;\/&gt;<br \/>\n**\/\/\u8fd9\u4e2a\u5c31\u662f\u6211\u4eec\u8981\u6539\u6e90\u7801\u7684\u5730\u65b9**<br \/>\n&lt;bean id=&#8221;formAuthenticationFilter&#8221; class=&#8221;com.zonekey.disrec.common.utils.redirectIP.MyFormAuthenticationFilter&#8221; \/&gt;<br \/>\n&lt;!&#8211; \u4fdd\u8bc1\u5b9e\u73b0\u4e86Shiro\u5185\u90e8lifecycle\u51fd\u6570\u7684bean\u6267\u884c &#8211;&gt;<br \/>\n&lt;bean id=&#8221;lifecycleBeanPostProcessor&#8221; class=&#8221;org.apache.shiro.spring.LifecycleBeanPostProcessor&#8221;\/&gt;<br \/>\n&lt;!&#8211; \u76f8\u5f53\u4e8e\u8c03\u7528SecurityUtils.setSecurityManager(securityManager) &#8211;&gt;<\/p>\n<p>&lt;bean class=&#8221;org.springframework.beans.factory.config.MethodInvokingFactoryBean&#8221;&gt;<br \/>\n&lt;property name=&#8221;staticMethod&#8221; value=&#8221;org.apache.shiro.SecurityUtils.setSecurityManager&#8221; \/&gt;<br \/>\n&lt;property name=&#8221;arguments&#8221; ref=&#8221;securityManager&#8221; \/&gt;<br \/>\n&lt;\/bean&gt;<\/p>\n<p>\u4e00\u822c\u662f\u4e0d\u9700\u8981\u6539\u52a8\u6e90\u7801\uff0c\u53ea\u662f\u7528\u5b50\u7c7b\u7ee7\u627f\u57fa\u7c7b\u80fd\u8fbe\u5230\u6539\u52a8\u6548\u679c<\/p>\n<p>package com.zonekey.disrec.common.utils.redirectIP;<\/p>\n<p>import java.io.IOException;<\/p>\n<p>import javax.servlet.ServletContext;<br \/>\nimport javax.servlet.ServletRequest;<br \/>\nimport javax.servlet.ServletResponse;<br \/>\nimport javax.servlet.http.HttpServletRequest;<br \/>\nimport javax.servlet.http.HttpServletResponse;<\/p>\n<p>import org.apache.shiro.cas.CasFilter;<br \/>\nimport org.apache.shiro.spring.web.ShiroFilterFactoryBean;<br \/>\nimport org.apache.shiro.web.filter.authc.FormAuthenticationFilter;<br \/>\nimport org.apache.shiro.web.filter.authc.LogoutFilter;<br \/>\nimport org.apache.shiro.web.util.WebUtils;<br \/>\nimport org.springframework.context.ApplicationContext;<br \/>\nimport org.springframework.web.context.support.WebApplicationContextUtils;<\/p>\n<p>import com.zonekey.disrec.service.auth.ShiroDbRealm;<\/p>\n<p>public class MyFormAuthenticationFilter extends FormAuthenticationFilter{<\/p>\n<p>\/**<br \/>\n* loginUrl\u5730\u5740\u91cd\u5199<br \/>\n*\/<br \/>\nprotected void redirectToLogin(ServletRequest request, ServletResponse response) throws IOException {<br \/>\nHttpServletRequest req=(HttpServletRequest)request;<br \/>\nHttpServletResponse res=(HttpServletResponse)response;<br \/>\n\/\/\u52a8\u6001\u83b7\u53d6\u8bf7\u6c42\u670d\u52a1\u7aef\u7684\u5730\u5740<br \/>\nString serverIp=req.getRequestURL().toString();<br \/>\n\/\/\u8bf7\u6c42\u8d44\u6e90<br \/>\nString serverAddr=req.getRequestURI();<br \/>\n\/\/\u52a8\u6001\u622a\u53d6\u8bf7\u6c42\u670d\u52a1IP<br \/>\nString commonIp=serverIp.substring(0,serverIp.indexOf(serverAddr));<br \/>\n\/\/System.out.println(&#8220;commonIP:&#8221;+commonIp);<br \/>\n\/\/String common_in = ReadProperties.getByName(&#8220;common_in.ip&#8221;);<br \/>\nString login_in = HttpConnectionUtil.getByName(&#8220;login_in.ip&#8221;);<br \/>\nif(login_in==null) login_in= commonIp+&#8221;\/cas&#8221;;<br \/>\n\/\/String common_out = ReadProperties.getByName(&#8220;common_out.ip&#8221;);<br \/>\nString login_out = HttpConnectionUtil.getByName(&#8220;login_out.ip&#8221;);<br \/>\nif(login_out==null) login_out= commonIp+&#8221;\/cas&#8221;;<br \/>\n\/\/\u83b7\u53d6servletContext\u5bb9\u5668<br \/>\nServletContext sc=req.getSession().getServletContext();<br \/>\n\/\/\u83b7\u53d6web\u73af\u5883\u4e0bspring\u5bb9\u5668<br \/>\nApplicationContext ac=WebApplicationContextUtils.getWebApplicationContext(sc);<br \/>\n\/\/ApplicationContextUtil ac=new ApplicationContextUtil();<br \/>\nShiroDbRealm shiroDbRealm=(ShiroDbRealm)ac.getBean(&#8220;casRealm&#8221;);<br \/>\nLogoutFilter logoutFilter=(LogoutFilter)ac.getBean(&#8220;logout&#8221;);<\/p>\n<p>\/\/\u4e00\u4e00\u4e00\u4e00\u4e00\u4e00\u4e00\u4e00\u4e00\u4e00\u4e00\u6ce8\u610f\u662f\u6b64\u5904\u4e00\u4e00\u4e00\u4e00\u4e00\u4e00\u4e00\u4e00\u4e00\u4e00\u4e00\u4e00\u4e00\u4e00\u4e00\u4e00\u4e00\u4e00\u4e00<br \/>\nShiroFilterFactoryBean shiroFilter=(ShiroFilterFactoryBean) ac.getBean(&#8220;&amp;shiroFilter&#8221;);<br \/>\nString clientIP=null;<br \/>\nif (req.getHeader(&#8220;x-forwarded-for&#8221;) == null) {<br \/>\nclientIP=req.getRemoteAddr();<br \/>\n}else{<br \/>\nclientIP=req.getHeader(&#8220;x-forwarded-for&#8221;);<br \/>\n}<br \/>\n\/*System.out.println(&#8220;clientIp:&#8221;+clientIP);<br \/>\nSystem.out.println(&#8220;isInner:&#8221;+HttpConnectionUtil.isInner(clientIP));*\/<br \/>\nif(!HttpConnectionUtil.isInner(clientIP)){<br \/>\nshiroFilter.setLoginUrl(login_out+&#8221;\/login?service=&#8221;+commonIp+req.getContextPath()+&#8221;\/shiro-cas&#8221;);<br \/>\n\/\/casFilter.setFailureUrl(map.get(&#8220;common_out.ip&#8221;)+&#8221;\/disrec&#8221;);<br \/>\n\/\/shiroDbRealm.setCasServerUrlPrefix(login_out);<br \/>\nshiroDbRealm.setCasService(commonIp+req.getContextPath()+&#8221;\/shiro-cas&#8221;);<br \/>\nlogoutFilter.setRedirectUrl(login_out+&#8221;\/logout?service=&#8221;+commonIp+req.getContextPath()+&#8221;\/shiro-cas&#8221;);<br \/>\n\/\/\u4e8c\u4e8c\u4e8c${common_out.ip}\/sysmanagement\/shiro-cas<br \/>\n}else{<br \/>\nshiroFilter.setLoginUrl(login_in+&#8221;\/login?service=&#8221;+commonIp+req.getContextPath()+&#8221;\/shiro-cas&#8221;);<br \/>\n\/\/casFilter.setFailureUrl(map.get(&#8220;common_in.ip&#8221;)+&#8221;\/disrec&#8221;);<br \/>\n\/\/shiroDbRealm.setCasServerUrlPrefix(login_in);<br \/>\nshiroDbRealm.setCasService(commonIp+req.getContextPath()+&#8221;\/shiro-cas&#8221;);<br \/>\nlogoutFilter.setRedirectUrl(login_in+&#8221;\/logout?service=&#8221;+commonIp+req.getContextPath()+&#8221;\/shiro-cas&#8221;);<br \/>\n}<br \/>\nWebUtils.issueRedirect(req, res, shiroFilter.getLoginUrl());<br \/>\n}<\/p>\n<p>}<\/p>\n<p>\u7531\u6b64\u53ccIP\u95ee\u9898\u5f97\u5230\u4e86\u89e3\u51b3<\/p>\n<p>\u6574\u4e2a\u601d\u8def\uff1aclient\u53d1\u8d77\u8bf7\u6c42\uff0c\u622a\u53d6\u5230client\u7684\u8bf7\u6c42\u8def\u5f84\u5224\u65ad\u7528\u6237IP\u662f\u5185\u7f51\u8fd8\u662f\u5916\u7f51\u8bbf\u95ee\uff0c\u7136\u540e\u518d\u8ba4\u8bc1\u6210\u529f\u91cd\u5b9a\u5411\u8def\u5f84\u52a8\u6001\u91cd\u5199\u767b\u9646\u6210\u529f\u8df3\u8f6c\u7684\u8def\u5f84\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u9879\u76ee\u5206\u7ed9\u6211\u4e00\u4e2a\u9700\u6c42\u89e3\u51b3CAS\u8ba4\u8bc1\u767b\u9646\u7684\u5185\u5916\u7f51\u53ccIP\u8bbf\u95ee\u7684\u95ee\u9898\uff0c\u5f53\u4f7f\u7528\u901a\u7528\u7684CAS\u7edf\u4e00\u8ba4\u8bc1\u670d\u52a1\u65f6\uff0c\u7531\u4e8eWEB [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-3728","post","type-post","status-publish","format-standard","hentry","category-day"],"_links":{"self":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts\/3728","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3728"}],"version-history":[{"count":1,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts\/3728\/revisions"}],"predecessor-version":[{"id":3729,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts\/3728\/revisions\/3729"}],"wp:attachment":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3728"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}