{"id":64209,"date":"2026-01-23T00:48:27","date_gmt":"2026-01-22T16:48:27","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/64209.html"},"modified":"2026-01-23T00:48:27","modified_gmt":"2026-01-22T16:48:27","slug":"%e5%ae%9e%e7%8e%b0%e7%99%bb%e5%bd%95%e6%8b%a6%e6%88%aa%e5%8a%9f%e8%83%bd","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/64209.html","title":{"rendered":"\u5b9e\u73b0\u767b\u5f55\u62e6\u622a\u529f\u80fd"},"content":{"rendered":"<h3>\u4e00\u3001\u524d\u8a00&#xff1a;\u4e3a\u4ec0\u4e48\u9700\u8981\u767b\u5f55\u62e6\u622a&#xff1f;<\/h3>\n<p>\u5728\u4e00\u4e2a\u5178\u578b\u7684 Web \u5e94\u7528\u4e2d&#xff0c;\u6211\u4eec\u7ecf\u5e38\u9047\u5230\u8fd9\u6837\u7684\u9700\u6c42&#xff1a;<\/p>\n<ul>\n<li>\u7528\u6237\u672a\u767b\u5f55\u65f6&#xff0c;\u8bbf\u95ee\u00a0\/user\/profile\u00a0\u5e94\u81ea\u52a8\u8df3\u8f6c\u5230\u767b\u5f55\u9875<\/li>\n<li>\u7ba1\u7406\u5458\u624d\u80fd\u8bbf\u95ee\u00a0\/admin\/*\u00a0\u8def\u5f84<\/li>\n<li>\u67d0\u4e9b\u63a5\u53e3\u53ea\u5141\u8bb8\u5df2\u8ba4\u8bc1\u7528\u6237\u8c03\u7528&#xff08;\u5982\u4fee\u6539\u5bc6\u7801\u3001\u4e0b\u5355&#xff09;<\/li>\n<\/ul>\n<p>\u5982\u679c\u6bcf\u4e2a Controller \u90fd\u624b\u52a8\u5199\u00a0if (session &#061;&#061; null)&#xff0c;\u4e0d\u4ec5\u91cd\u590d\u3001\u6613\u6f0f&#xff0c;\u8fd8\u96be\u4ee5\u7ef4\u62a4\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6848&#xff1a;\u4f7f\u7528 Spring MVC \u62e6\u622a\u5668&#xff08;Interceptor&#xff09;\u7edf\u4e00\u5904\u7406&#xff01;<\/p>\n<p>\u672c\u6587\u5c06\u5e26\u4f60&#xff1a; \u2705 \u624b\u52a8\u5b9e\u73b0\u767b\u5f55\u72b6\u6001\u62e6\u622a \u2705 \u7cbe\u51c6\u914d\u7f6e\u62e6\u622a\u8def\u5f84\u4e0e\u653e\u884c\u89c4\u5219 \u2705 \u652f\u6301 JSON \u63a5\u53e3\u8fd4\u56de 401&#xff08;\u524d\u540e\u7aef\u5206\u79bb\u573a\u666f&#xff09; \u2705 \u907f\u5f00\u5e38\u89c1\u9677\u9631&#xff08;\u5982\u9759\u6001\u8d44\u6e90\u88ab\u62e6\u622a&#xff09;<\/p>\n<hr \/>\n<h3>\u4e8c\u3001\u6838\u5fc3\u539f\u7406&#xff1a;\u62e6\u622a\u5668 vs \u8fc7\u6ee4\u5668<\/h3>\n<table>\n<tr>\u7279\u6027\u62e6\u622a\u5668&#xff08;Interceptor&#xff09;\u8fc7\u6ee4\u5668&#xff08;Filter&#xff09;<\/tr>\n<tbody>\n<tr>\n<td>\u6240\u5c5e\u6846\u67b6<\/td>\n<td>Spring MVC<\/td>\n<td>Servlet \u5bb9\u5668<\/td>\n<\/tr>\n<tr>\n<td>\u80fd\u5426\u6ce8\u5165 Bean<\/td>\n<td>\u2705 \u53ef\u4ee5<\/td>\n<td>\u274c \u4e0d\u884c&#xff08;\u9664\u975e\u7279\u6b8a\u914d\u7f6e&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u6267\u884c\u65f6\u673a<\/td>\n<td>Controller \u65b9\u6cd5\u8c03\u7528\u524d\u540e<\/td>\n<td>\u8bf7\u6c42\u8fdb\u5165\u5bb9\u5668\u65f6<\/td>\n<\/tr>\n<tr>\n<td>\u662f\u5426\u652f\u6301\u8def\u5f84\u5339\u914d<\/td>\n<td>\u2705 \u7cbe\u786e&#xff08;AntPathMatcher&#xff09;<\/td>\n<td>\u274c \u9700\u624b\u52a8\u89e3\u6790 URL<\/td>\n<\/tr>\n<tr>\n<td>\u9002\u7528\u573a\u666f<\/td>\n<td>\u4e1a\u52a1\u7ea7\u62e6\u622a&#xff08;\u5982\u767b\u5f55\u3001\u6743\u9650&#xff09;<\/td>\n<td>\u7f16\u7801\u3001\u65e5\u5fd7\u3001\u5b89\u5168\u5934\u7b49\u5e95\u5c42\u5904\u7406<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#x1f4cc;\u00a0\u7ed3\u8bba&#xff1a;\u767b\u5f55\u62e6\u622a\u4f18\u5148\u4f7f\u7528 Interceptor&#xff01;<\/p>\n<hr \/>\n<h3>\u4e09\u3001\u5b9e\u6218&#xff1a;\u57fa\u4e8e Session \u7684\u767b\u5f55\u62e6\u622a\u5668<\/h3>\n<h4>1. \u524d\u63d0&#xff1a;\u5df2\u6709\u767b\u5f55\u903b\u8f91&#xff08;\u5b58 Session&#xff09;<\/h4>\n<p>\u5047\u8bbe\u7528\u6237\u767b\u5f55\u6210\u529f\u540e&#xff0c;\u5df2\u5c06\u7528\u6237\u540d\u5b58\u5165 Session&#xff1a;<\/p>\n<p>\/\/ \u767b\u5f55\u6210\u529f\u65f6<br \/>\nsession.setAttribute(&#034;currentUser&#034;, &#034;zhangsan&#034;); <\/p>\n<hr \/>\n<h4>2. \u81ea\u5b9a\u4e49\u62e6\u622a\u5668<\/h4>\n<p>&#064;Component<br \/>\npublic class LoginInterceptor implements HandlerInterceptor {<\/p>\n<p>    &#064;Override<br \/>\n    public boolean preHandle(HttpServletRequest request,<br \/>\n                             HttpServletResponse response,<br \/>\n                             Object handler) throws Exception {<\/p>\n<p>        \/\/ 1. \u83b7\u53d6\u5f53\u524d\u4f1a\u8bdd<br \/>\n        HttpSession session &#061; request.getSession(false);<\/p>\n<p>        \/\/ 2. \u5224\u65ad\u662f\u5426\u5df2\u767b\u5f55<br \/>\n        if (session &#061;&#061; null || session.getAttribute(&#034;currentUser&#034;) &#061;&#061; null) {<\/p>\n<p>            \/\/ 3. \u5224\u65ad\u662f\u9875\u9762\u8bf7\u6c42\u8fd8\u662f AJAX \u8bf7\u6c42<br \/>\n            String contentType &#061; request.getHeader(&#034;Content-Type&#034;);<br \/>\n            String accept &#061; request.getHeader(&#034;Accept&#034;);<\/p>\n<p>            boolean isAjax &#061; (contentType !&#061; null &amp;&amp; contentType.contains(&#034;application\/json&#034;)) ||<br \/>\n                             (accept !&#061; null &amp;&amp; accept.contains(&#034;application\/json&#034;));<\/p>\n<p>            if (isAjax) {<br \/>\n                \/\/ \u524d\u540e\u7aef\u5206\u79bb&#xff1a;\u8fd4\u56de JSON \u9519\u8bef<br \/>\n                response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);<br \/>\n                response.setContentType(&#034;application\/json;charset&#061;UTF-8&#034;);<br \/>\n                response.getWriter().write(&#034;{\\\\&#034;code\\\\&#034;:401,\\\\&#034;msg\\\\&#034;:\\\\&#034;\u8bf7\u5148\u767b\u5f55\\\\&#034;}&#034;);<br \/>\n                return false;<br \/>\n            } else {<br \/>\n                \/\/ \u4f20\u7edf Web&#xff1a;\u91cd\u5b9a\u5411\u5230\u767b\u5f55\u9875<br \/>\n                response.sendRedirect(&#034;\/login&#034;);<br \/>\n                return false;<br \/>\n            }<br \/>\n        }<\/p>\n<p>        \/\/ \u5df2\u767b\u5f55&#xff0c;\u653e\u884c<br \/>\n        return true;<br \/>\n    }<br \/>\n} <\/p>\n<p>\u2705\u00a0\u667a\u80fd\u5224\u65ad&#xff1a;\u81ea\u52a8\u533a\u5206\u9875\u9762\u8df3\u8f6c\u548c API \u8c03\u7528&#xff0c;\u8fd4\u56de\u4e0d\u540c\u54cd\u5e94&#xff01;<\/p>\n<hr \/>\n<h4>3. \u6ce8\u518c\u62e6\u622a\u5668\u5e76\u914d\u7f6e\u8def\u5f84<\/h4>\n<p>&#064;Configuration<br \/>\npublic class WebConfig implements WebMvcConfigurer {<\/p>\n<p>    &#064;Autowired<br \/>\n    private LoginInterceptor loginInterceptor;<\/p>\n<p>    &#064;Override<br \/>\n    public void addInterceptors(InterceptorRegistry registry) {<br \/>\n        registry.addInterceptor(loginInterceptor)<br \/>\n                \/\/ \u62e6\u622a\u54ea\u4e9b\u8def\u5f84<br \/>\n                .addPathPatterns(&#034;\/user\/**&#034;, &#034;\/order\/**&#034;, &#034;\/profile\/**&#034;)<br \/>\n                \/\/ \u653e\u884c\u54ea\u4e9b\u8def\u5f84&#xff08;\u5fc5\u987b\u653e\u884c\u767b\u5f55\u3001\u9759\u6001\u8d44\u6e90\u7b49&#xff09;<br \/>\n                .excludePathPatterns(<br \/>\n                    &#034;\/login&#034;,<br \/>\n                    &#034;\/doLogin&#034;,<br \/>\n                    &#034;\/logout&#034;,<br \/>\n                    &#034;\/css\/**&#034;,<br \/>\n                    &#034;\/js\/**&#034;,<br \/>\n                    &#034;\/images\/**&#034;,<br \/>\n                    &#034;\/captcha&#034;,          \/\/ \u56fe\u5f62\u9a8c\u8bc1\u7801<br \/>\n                    &#034;\/error&#034;,            \/\/ \u9519\u8bef\u9875<br \/>\n                    &#034;\/webjars\/**&#034;        \/\/ Bootstrap \u7b49<br \/>\n                );<br \/>\n    }<br \/>\n} <\/p>\n<p>&#x1f511;\u00a0\u5173\u952e\u70b9&#xff1a;<\/p>\n<ul>\n<li>addPathPatterns&#xff1a;\u6307\u5b9a\u9700\u8981\u4fdd\u62a4\u7684\u8def\u5f84<\/li>\n<li>excludePathPatterns&#xff1a;\u5fc5\u987b\u653e\u884c\u767b\u5f55\u76f8\u5173\u548c\u9759\u6001\u8d44\u6e90&#xff0c;\u5426\u5219\u9875\u9762\u6837\u5f0f\u4e22\u5931&#xff01;<\/li>\n<\/ul>\n<hr \/>\n<h3>\u56db\u3001\u8fdb\u9636&#xff1a;\u652f\u6301\u89d2\u8272\u6743\u9650\u62e6\u622a&#xff08;\u53ef\u9009&#xff09;<\/h3>\n<p>\u5982\u679c\u9700\u8981\u533a\u5206\u666e\u901a\u7528\u6237\u548c\u7ba1\u7406\u5458&#xff1a;<\/p>\n<p>\/\/ \u767b\u5f55\u65f6\u5b58\u5165\u89d2\u8272<br \/>\nsession.setAttribute(&#034;role&#034;, &#034;admin&#034;);<\/p>\n<p>\/\/ \u62e6\u622a\u5668\u4e2d\u589e\u5f3a\u5224\u65ad<br \/>\nString role &#061; (String) session.getAttribute(&#034;role&#034;);<br \/>\nif (!&#034;admin&#034;.equals(role)) {<br \/>\n    response.sendError(403, &#034;\u65e0\u6743\u8bbf\u95ee&#034;);<br \/>\n    return false;<br \/>\n} <\/p>\n<p>\u6216\u5b9a\u4e49\u591a\u4e2a\u62e6\u622a\u5668&#xff1a;<\/p>\n<ul>\n<li>LoginInterceptor&#xff1a;\u53ea\u6821\u9a8c\u662f\u5426\u767b\u5f55<\/li>\n<li>AdminInterceptor&#xff1a;\u6821\u9a8c\u662f\u5426\u4e3a\u7ba1\u7406\u5458&#xff08;\u5e94\u7528\u4e8e\u00a0\/admin\/**&#xff09;<\/li>\n<\/ul>\n<hr \/>\n<h3>\u4e94\u3001\u524d\u540e\u7aef\u5206\u79bb\u573a\u666f&#xff1a;\u7eaf API \u62e6\u622a<\/h3>\n<p>\u5982\u679c\u4f60\u7684\u9879\u76ee\u662f Vue\/React &#043; Spring Boot&#xff0c;\u6240\u6709\u63a5\u53e3\u90fd\u8fd4\u56de JSON&#xff0c;\u53ef\u7b80\u5316\u62e6\u622a\u5668&#xff1a;<\/p>\n<p>&#064;Component<br \/>\npublic class ApiLoginInterceptor implements HandlerInterceptor {<\/p>\n<p>    &#064;Override<br \/>\n    public boolean preHandle(HttpServletRequest request,<br \/>\n                             HttpServletResponse response,<br \/>\n                             Object handler) throws Exception {<\/p>\n<p>        HttpSession session &#061; request.getSession(false);<br \/>\n        if (session &#061;&#061; null || session.getAttribute(&#034;currentUser&#034;) &#061;&#061; null) {<br \/>\n            response.setStatus(401);<br \/>\n            response.setContentType(&#034;application\/json;charset&#061;UTF-8&#034;);<br \/>\n            response.getWriter().write(&#034;{\\\\&#034;error\\\\&#034;:\\\\&#034;Unauthorized\\\\&#034;,\\\\&#034;message\\\\&#034;:\\\\&#034;\u8bf7\u5148\u767b\u5f55\\\\&#034;}&#034;);<br \/>\n            return false;<br \/>\n        }<br \/>\n        return true;<br \/>\n    }<br \/>\n}<\/p>\n<p>\/\/ \u914d\u7f6e&#xff1a;\u62e6\u622a\u6240\u6709 \/api\/** \u5f00\u5934\u7684\u8bf7\u6c42<br \/>\n&#064;Override<br \/>\npublic void addInterceptors(InterceptorRegistry registry) {<br \/>\n    registry.addInterceptor(new ApiLoginInterceptor())<br \/>\n            .addPathPatterns(&#034;\/api\/**&#034;)<br \/>\n            .excludePathPatterns(&#034;\/api\/auth\/login&#034;, &#034;\/api\/public\/**&#034;);<br \/>\n} <\/p>\n<p>&#x1f4a1; \u524d\u7aef\u6536\u5230 401 \u540e&#xff0c;\u8df3\u8f6c\u5230\u767b\u5f55\u9875\u5373\u53ef\u3002<\/p>\n<hr \/>\n<h3>\u516d\u3001\u907f\u5751\u6307\u5357&#xff1a;\u5e38\u89c1\u95ee\u9898\u4e0e\u89e3\u51b3\u65b9\u6848<\/h3>\n<h4>\u274c \u5751 1&#xff1a;\u9759\u6001\u8d44\u6e90&#xff08;CSS\/JS&#xff09;\u88ab\u62e6\u622a&#xff0c;\u9875\u9762\u6837\u5f0f\u9519\u4e71<\/h4>\n<p>\u539f\u56e0&#xff1a;\u672a\u5728\u00a0excludePathPatterns\u00a0\u4e2d\u653e\u884c\u00a0\/css\/**\u00a0\u7b49\u8def\u5f84 \u89e3\u51b3&#xff1a;\u52a1\u5fc5\u653e\u884c\u6240\u6709\u9759\u6001\u8d44\u6e90\u76ee\u5f55<\/p>\n<h4>\u274c \u5751 2&#xff1a;\u767b\u5f55\u6210\u529f\u540e\u4ecd\u88ab\u62e6\u622a<\/h4>\n<p>\u539f\u56e0&#xff1a;Session \u672a\u6b63\u786e\u521b\u5efa&#xff0c;\u6216\u62e6\u622a\u5668\u6267\u884c\u987a\u5e8f\u95ee\u9898 \u6392\u67e5&#xff1a;<\/p>\n<ul>\n<li>\u68c0\u67e5\u00a0session.setAttribute()\u00a0\u662f\u5426\u6267\u884c<\/li>\n<li>\u786e\u4fdd\u767b\u5f55\u63a5\u53e3\u5728\u00a0excludePathPatterns\u00a0\u4e2d<\/li>\n<\/ul>\n<h4>\u274c \u5751 3&#xff1a;\u62e6\u622a\u5668\u4e2d\u65e0\u6cd5\u6ce8\u5165\u5176\u4ed6 Service<\/h4>\n<p>\u539f\u56e0&#xff1a;\u62e6\u622a\u5668\u672a\u88ab Spring \u7ba1\u7406 \u89e3\u51b3&#xff1a;\u52a0\u4e0a\u00a0&#064;Component\u00a0\u6ce8\u89e3&#xff0c;\u5e76\u901a\u8fc7\u00a0&#064;Autowired\u00a0\u6ce8\u5165<\/p>\n<h4>\u274c \u5751 4&#xff1a;\u8de8\u57df\u8bf7\u6c42\u5bfc\u81f4 Cookie \u4e22\u5931&#xff08;\u524d\u540e\u7aef\u5206\u79bb&#xff09;<\/h4>\n<p>\u73b0\u8c61&#xff1a;\u524d\u7aef\u643a\u5e26\u00a0withCredentials: true&#xff0c;\u4f46\u540e\u7aef\u6536\u4e0d\u5230 JSESSIONID \u89e3\u51b3&#xff1a;\u914d\u7f6e CORS \u5141\u8bb8\u51ed\u8bc1<\/p>\n<p> &#064;Bean<br \/>\npublic CorsConfigurationSource corsConfigurationSource() {<br \/>\n    CorsConfiguration config &#061; new CorsConfiguration();<br \/>\n    config.setAllowCredentials(true);<br \/>\n    config.addAllowedOrigin(&#034;http:\/\/localhost:8080&#034;);<br \/>\n    config.addAllowedHeader(&#034;*&#034;);<br \/>\n    config.addAllowedMethod(&#034;*&#034;);<br \/>\n    UrlBasedCorsConfigurationSource source &#061; new UrlBasedCorsConfigurationSource();<br \/>\n    source.registerCorsConfiguration(&#034;\/**&#034;, config);<br \/>\n    return source;<br \/>\n} <\/p>\n<hr \/>\n<h3>\u4e03\u3001\u66ff\u4ee3\u65b9\u6848\u5bf9\u6bd4<\/h3>\n<table>\n<tr>\u65b9\u6848\u4f18\u70b9\u7f3a\u70b9\u9002\u7528\u573a\u666f<\/tr>\n<tbody>\n<tr>\n<td>\u81ea\u5b9a\u4e49 Interceptor<\/td>\n<td>\u7b80\u5355\u3001\u7075\u6d3b\u3001\u53ef\u63a7<\/td>\n<td>\u9700\u624b\u52a8\u7ef4\u62a4<\/td>\n<td>\u4e2d\u5c0f\u578b\u9879\u76ee<\/td>\n<\/tr>\n<tr>\n<td>Spring Security<\/td>\n<td>\u529f\u80fd\u5f3a\u5927\u3001\u4f01\u4e1a\u7ea7<\/td>\n<td>\u5b66\u4e60\u6210\u672c\u9ad8<\/td>\n<td>\u5927\u578b\u7cfb\u7edf\u3001\u9ad8\u5b89\u5168\u8981\u6c42<\/td>\n<\/tr>\n<tr>\n<td>AOP \u5207\u9762<\/td>\n<td>\u53ef\u6309\u6ce8\u89e3\u62e6\u622a<\/td>\n<td>\u65e0\u6cd5\u5904\u7406 URL \u8def\u5f84<\/td>\n<td>\u7279\u5b9a\u65b9\u6cd5\u7ea7\u63a7\u5236<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#x1f4cc;\u00a0\u5efa\u8bae&#xff1a;<\/p>\n<ul>\n<li>\u5feb\u901f\u4e0a\u7ebf \u2192\u00a0Interceptor<\/li>\n<li>\u91d1\u878d\/\u653f\u52a1\u7cfb\u7edf \u2192\u00a0Spring Security<\/li>\n<\/ul>\n<hr \/>\n<h3>\u516b\u3001\u7ed3\u8bed<\/h3>\n<p>\u611f\u8c22\u60a8\u7684\u9605\u8bfb&#xff01;\u5982\u679c\u4f60\u6709\u4efb\u4f55\u7591\u95ee\u6216\u60f3\u8981\u5206\u4eab\u7684\u7ecf\u9a8c&#xff0c;\u8bf7\u5728\u8bc4\u8bba\u533a\u7559\u8a00\u4ea4\u6d41&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u524d\u8a00&#xff1a;\u4e3a\u4ec0\u4e48\u9700\u8981\u767b\u5f55\u62e6\u622a&#xff1f;<br \/>\n\u5728\u4e00\u4e2a\u5178\u578b\u7684 Web \u5e94\u7528\u4e2d&#xff0c;\u6211\u4eec\u7ecf\u5e38\u9047\u5230\u8fd9\u6837\u7684\u9700\u6c42&#xff1a;<br \/>\n\u7528\u6237\u672a\u767b\u5f55\u65f6&#xff0c;\u8bbf\u95ee\u00a0\/user\/profile\u00a0\u5e94\u81ea\u52a8\u8df3\u8f6c\u5230\u767b\u5f55\u9875\u7ba1\u7406\u5458\u624d\u80fd\u8bbf\u95ee\u00a0\/admin\/*\u00a0\u8def\u5f84\u67d0\u4e9b\u63a5\u53e3\u53ea\u5141\u8bb8\u5df2\u8ba4\u8bc1\u7528\u6237\u8c03\u7528&#xff08;\u5982\u4fee\u6539\u5bc6\u7801\u3001\u4e0b\u5355&#xff09;<br \/>\n\u5982\u679c\u6bcf\u4e2a Controller \u90fd\u624b\u52a8\u5199\u00a0if (session  null)&#xff0c;\u4e0d\u4ec5\u91cd\u590d\u3001\u6613\u6f0f&#xff0c;\u8fd8\u96be\u4ee5\u7ef4\u62a4<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[105,398],"topic":[],"class_list":["post-64209","post","type-post","status-publish","format-standard","hentry","category-server","tag-redis","tag-398"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5b9e\u73b0\u767b\u5f55\u62e6\u622a\u529f\u80fd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/64209.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5b9e\u73b0\u767b\u5f55\u62e6\u622a\u529f\u80fd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001\u524d\u8a00&#xff1a;\u4e3a\u4ec0\u4e48\u9700\u8981\u767b\u5f55\u62e6\u622a&#xff1f; \u5728\u4e00\u4e2a\u5178\u578b\u7684 Web \u5e94\u7528\u4e2d&#xff0c;\u6211\u4eec\u7ecf\u5e38\u9047\u5230\u8fd9\u6837\u7684\u9700\u6c42&#xff1a; \u7528\u6237\u672a\u767b\u5f55\u65f6&#xff0c;\u8bbf\u95ee\u00a0\/user\/profile\u00a0\u5e94\u81ea\u52a8\u8df3\u8f6c\u5230\u767b\u5f55\u9875\u7ba1\u7406\u5458\u624d\u80fd\u8bbf\u95ee\u00a0\/admin\/*\u00a0\u8def\u5f84\u67d0\u4e9b\u63a5\u53e3\u53ea\u5141\u8bb8\u5df2\u8ba4\u8bc1\u7528\u6237\u8c03\u7528&#xff08;\u5982\u4fee\u6539\u5bc6\u7801\u3001\u4e0b\u5355&#xff09; \u5982\u679c\u6bcf\u4e2a Controller \u90fd\u624b\u52a8\u5199\u00a0if (session null)&#xff0c;\u4e0d\u4ec5\u91cd\u590d\u3001\u6613\u6f0f&#xff0c;\u8fd8\u96be\u4ee5\u7ef4\u62a4\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/64209.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-22T16:48:27+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/64209.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/64209.html\",\"name\":\"\u5b9e\u73b0\u767b\u5f55\u62e6\u622a\u529f\u80fd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-22T16:48:27+00:00\",\"dateModified\":\"2026-01-22T16:48:27+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/64209.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/64209.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/64209.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5b9e\u73b0\u767b\u5f55\u62e6\u622a\u529f\u80fd\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5b9e\u73b0\u767b\u5f55\u62e6\u622a\u529f\u80fd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/64209.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5b9e\u73b0\u767b\u5f55\u62e6\u622a\u529f\u80fd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u3001\u524d\u8a00&#xff1a;\u4e3a\u4ec0\u4e48\u9700\u8981\u767b\u5f55\u62e6\u622a&#xff1f; \u5728\u4e00\u4e2a\u5178\u578b\u7684 Web \u5e94\u7528\u4e2d&#xff0c;\u6211\u4eec\u7ecf\u5e38\u9047\u5230\u8fd9\u6837\u7684\u9700\u6c42&#xff1a; \u7528\u6237\u672a\u767b\u5f55\u65f6&#xff0c;\u8bbf\u95ee\u00a0\/user\/profile\u00a0\u5e94\u81ea\u52a8\u8df3\u8f6c\u5230\u767b\u5f55\u9875\u7ba1\u7406\u5458\u624d\u80fd\u8bbf\u95ee\u00a0\/admin\/*\u00a0\u8def\u5f84\u67d0\u4e9b\u63a5\u53e3\u53ea\u5141\u8bb8\u5df2\u8ba4\u8bc1\u7528\u6237\u8c03\u7528&#xff08;\u5982\u4fee\u6539\u5bc6\u7801\u3001\u4e0b\u5355&#xff09; \u5982\u679c\u6bcf\u4e2a Controller \u90fd\u624b\u52a8\u5199\u00a0if (session null)&#xff0c;\u4e0d\u4ec5\u91cd\u590d\u3001\u6613\u6f0f&#xff0c;\u8fd8\u96be\u4ee5\u7ef4\u62a4","og_url":"https:\/\/www.wsisp.com\/helps\/64209.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-22T16:48:27+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/64209.html","url":"https:\/\/www.wsisp.com\/helps\/64209.html","name":"\u5b9e\u73b0\u767b\u5f55\u62e6\u622a\u529f\u80fd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-22T16:48:27+00:00","dateModified":"2026-01-22T16:48:27+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/64209.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/64209.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/64209.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5b9e\u73b0\u767b\u5f55\u62e6\u622a\u529f\u80fd"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/64209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=64209"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/64209\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=64209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=64209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=64209"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=64209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}