You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
23 KiB
JavaScript

1 year ago
"use strict";(self.webpackChunkfurion=self.webpackChunkfurion||[]).push([[8133],{4113:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>t,contentTitle:()=>d,default:()=>a,frontMatter:()=>c,metadata:()=>l,toc:()=>o});var r=s(5893),i=s(1151);const c={id:"cors",title:"16. CORS \u8de8\u57df",sidebar_label:"16. CORS \u8de8\u57df"},d=void 0,l={id:"cors",title:"16. CORS \u8de8\u57df",description:"16.1 \u4ec0\u4e48\u662f\u8de8\u57df",source:"@site/docs/cors.mdx",sourceDirName:".",slug:"/cors",permalink:"/docs/cors",draft:!1,unlisted:!1,editUrl:"https://gitee.com/dotnetchina/Furion/tree/v4/handbook/docs/cors.mdx",tags:[],version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1699252005,formattedLastUpdatedAt:"Nov 6, 2023",frontMatter:{id:"cors",title:"16. CORS \u8de8\u57df",sidebar_label:"16. CORS \u8de8\u57df"},sidebar:"docs",previous:{title:"15. \u5b89\u5168\u9274\u6743",permalink:"/docs/auth-control"},next:{title:"17. \u89c6\u56fe/\u6a21\u677f\u5f15\u64ce",permalink:"/docs/view-engine"}},t={},o=[{value:"16.1 \u4ec0\u4e48\u662f\u8de8\u57df",id:"161-\u4ec0\u4e48\u662f\u8de8\u57df",level:2},{value:"16.2 \u6709\u8de8\u57df\u884c\u4e3a\u793a\u4f8b",id:"162-\u6709\u8de8\u57df\u884c\u4e3a\u793a\u4f8b",level:2},{value:"16.3 \u4ec0\u4e48\u662f CORS",id:"163-\u4ec0\u4e48\u662f-cors",level:2},{value:"16.4 \u5982\u4f55\u4f7f\u7528",id:"164-\u5982\u4f55\u4f7f\u7528",level:2},{value:"16.4.1 \u6dfb\u52a0 <code>CORS</code> \u670d\u52a1",id:"1641-\u6dfb\u52a0-cors-\u670d\u52a1",level:3},{value:"16.4.2 \u914d\u7f6e\u5141\u8bb8\u8de8\u57df\u57df\u540d",id:"1642-\u914d\u7f6e\u5141\u8bb8\u8de8\u57df\u57df\u540d",level:3},{value:"16.5 <code>CorsAccessorSettings</code> \u914d\u7f6e",id:"165-corsaccessorsettings-\u914d\u7f6e",level:2},{value:"16.6 \u524d\u7aef\u4e0d\u80fd\u8bfb\u53d6\u54cd\u5e94\u5934\u6ce8\u610f\u4e8b\u9879",id:"166-\u524d\u7aef\u4e0d\u80fd\u8bfb\u53d6\u54cd\u5e94\u5934\u6ce8\u610f\u4e8b\u9879",level:2},{value:"16.7 \u4f7f\u7528 <code>$.ajax</code> \u524d\u7aef\u6ce8\u610f\u4e8b\u9879",id:"167-\u4f7f\u7528-ajax-\u524d\u7aef\u6ce8\u610f\u4e8b\u9879",level:2},{value:"16.8 \u7981\u7528\u8de8\u57df",id:"168-\u7981\u7528\u8de8\u57df",level:2},{value:"16.9 <code>SignalR</code> \u8de8\u57df\u95ee\u9898",id:"169-signalr-\u8de8\u57df\u95ee\u9898",level:2},{value:"16.10 \u9759\u6001\u8d44\u6e90\u8de8\u57df\u95ee\u9898",id:"1610-\u9759\u6001\u8d44\u6e90\u8de8\u57df\u95ee\u9898",level:2},{value:"16.11 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"1611-\u53cd\u9988\u4e0e\u5efa\u8bae",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h2,{id:"161-\u4ec0\u4e48\u662f\u8de8\u57df",children:"16.1 \u4ec0\u4e48\u662f\u8de8\u57df"}),"\n",(0,r.jsxs)(n.p,{children:["\u7b80\u5355\u6765\u8bf4\uff0c\u5f53\u4e00\u4e2a\u8bf7\u6c42 ",(0,r.jsx)(n.code,{children:"url"})," \u7684\u534f\u8bae\u3001\u57df\u540d\u3001\u7aef\u53e3\u4e09\u8005\u4e4b\u95f4\u4efb\u610f\u4e00\u4e2a\u4e0e\u5f53\u524d\u9875\u9762 ",(0,r.jsx)(n.code,{children:"url"})," \u4e0d\u540c\u5373\u4e3a\u8de8\u57df\u3002\u90a3\u4e3a\u4ec0\u4e48\u4f1a\u51fa\u73b0\u8de8\u57df\u95ee\u9898\u5462\uff1f"]}),"\n",(0,r.jsxs)(n.p,{children:["\u51fa\u4e8e\u6d4f\u89c8\u5668\u7684\u540c\u6e90\u7b56\u7565\u9650\u5236\u3002\u540c\u6e90\u7b56\u7565\uff08Sameoriginpolicy\uff09\u662f\u4e00\u79cd\u7ea6\u5b9a\uff0c\u5b83\u662f\u6d4f\u89c8\u5668\u6700\u6838\u5fc3\u4e5f\u6700\u57fa\u672c\u7684\u5b89\u5168\u529f\u80fd\uff0c\u5982\u679c\u7f3a\u5c11\u4e86\u540c\u6e90\u7b56\u7565\uff0c\u5219\u6d4f\u89c8\u5668\u7684\u6b63\u5e38\u529f\u80fd\u53ef\u80fd\u90fd\u4f1a\u53d7\u5230\u5f71\u54cd\u3002\u53ef\u4ee5\u8bf4 ",(0,r.jsx)(n.code,{children:"Web"})," \u662f\u6784\u5efa\u5728\u540c\u6e90\u7b56\u7565\u57fa\u7840\u4e4b\u4e0a\u7684\uff0c\u6d4f\u89c8\u5668\u53ea\u662f\u9488\u5bf9\u540c\u6e90\u7b56\u7565\u7684\u4e00\u79cd\u5b9e\u73b0\u3002\u540c\u6e90\u7b56\u7565\u4f1a\u963b\u6b62\u4e00\u4e2a\u57df\u7684 jav