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
32 KiB
JavaScript
1 line
32 KiB
JavaScript
1 year ago
|
"use strict";(self.webpackChunkfurion=self.webpackChunkfurion||[]).push([[5987],{3122:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>i,default:()=>x,frontMatter:()=>o,metadata:()=>l,toc:()=>a});var s=n(5893),r=n(1151),c=(n(4996),n(510));const o={id:"httpcontext",title:"5.2 HttpContext",sidebar_label:"5.2 HttpContext",description:"\u548c\u5ba2\u6237\u7aef\u4ea4\u4e92\uff0c\u6ca1\u5b83\u771f\u4e0d\u884c"},i=void 0,l={id:"httpcontext",title:"5.2 HttpContext",description:"\u548c\u5ba2\u6237\u7aef\u4ea4\u4e92\uff0c\u6ca1\u5b83\u771f\u4e0d\u884c",source:"@site/docs/httpcontext.mdx",sourceDirName:".",slug:"/httpcontext",permalink:"/docs/httpcontext",draft:!1,unlisted:!1,editUrl:"https://gitee.com/dotnetchina/Furion/tree/v4/handbook/docs/httpcontext.mdx",tags:[],version:"current",lastUpdatedBy:"MonkSoul",lastUpdatedAt:1679624314,formattedLastUpdatedAt:"Mar 24, 2023",frontMatter:{id:"httpcontext",title:"5.2 HttpContext",sidebar_label:"5.2 HttpContext",description:"\u548c\u5ba2\u6237\u7aef\u4ea4\u4e92\uff0c\u6ca1\u5b83\u771f\u4e0d\u884c"},sidebar:"docs",previous:{title:"5.1 \u52a8\u6001 WebAPI",permalink:"/docs/dynamic-api-controller"},next:{title:"5.3 \u7b5b\u9009\u5668/\u62e6\u622a\u5668/\u8fc7\u6ee4\u5668/AOP",permalink:"/docs/filter"}},d={},a=[{value:"5.2.1 \u5173\u4e8e <code>HttpContext</code>",id:"521-\u5173\u4e8e-httpcontext",level:2},{value:"5.2.2 \u83b7\u53d6 <code>HttpContext</code>",id:"522-\u83b7\u53d6-httpcontext",level:2},{value:"5.2.2.1 \u5728 <code>ControllerBase</code> \u6d3e\u751f\u7c7b\u4e2d",id:"5221-\u5728-controllerbase-\u6d3e\u751f\u7c7b\u4e2d",level:3},{value:"5.2.2.2 \u6ce8\u5165 <code>IHttpContextAccessor</code>",id:"5222-\u6ce8\u5165-ihttpcontextaccessor",level:3},{value:"5.2.2.3 \u901a\u8fc7 <code>App.HttpContext</code>",id:"5223-\u901a\u8fc7-apphttpcontext",level:3},{value:"5.2.3 <code>HttpContext</code> \u62d3\u5c55\u65b9\u6cd5",id:"523-httpcontext-\u62d3\u5c55\u65b9\u6cd5",level:2},{value:"5.2.3.1 \u83b7\u53d6\u5f53\u524d\u8bf7\u6c42\u7684\u7279\u6027 <code>Attribute</code>",id:"5231-\u83b7\u53d6\u5f53\u524d\u8bf7\u6c42\u7684\u7279\u6027-attribute",level:3},{value:"5.2.3.2 \u8bbe\u7f6e <code>Swagger</code> \u81ea\u52a8\u6388\u6743",id:"5232-\u8bbe\u7f6e-swagger-\u81ea\u52a8\u6388\u6743",level:3},{value:"5.2.3.3 \u9000\u51fa <code>Swagger</code> \u6388\u6743",id:"5233-\u9000\u51fa-swagger-\u6388\u6743",level:3},{value:"5.2.3.4 \u83b7\u53d6\u672c\u5730 IP \u5730\u5740",id:"5234-\u83b7\u53d6\u672c\u5730-ip-\u5730\u5740",level:3},{value:"5.2.3.5 \u83b7\u53d6\u5ba2\u6237\u7aef IP \u5730\u5740",id:"5235-\u83b7\u53d6\u5ba2\u6237\u7aef-ip-\u5730\u5740",level:3},{value:"5.2.3.6 \u8bbe\u7f6e\u54cd\u5e94\u5934 <code>Token</code>",id:"5236-\u8bbe\u7f6e\u54cd\u5e94\u5934-token",level:3},{value:"5.2.4 \u8bfb\u53d6 <code>Body</code> \u5185\u5bb9\uff08\u91cd\u590d\u8bfb\uff09",id:"524-\u8bfb\u53d6-body-\u5185\u5bb9\u91cd\u590d\u8bfb",level:2},{value:"5.2.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"525-\u53cd\u9988\u4e0e\u5efa\u8bae",level:2}];function h(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",mdxAdmonitionTitle:"mdxAdmonitionTitle",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components},{Details:n}=t;return n||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"\ud83d\udcdd \u6a21\u5757\u66f4\u65b0\u65e5\u5fd7"}),(0,s.jsx)("div",{children:(0,s.jsx)("div",{children:(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"\u95ee\u9898\u4fee\u590d"})}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:["\xa0",(0,s.jsx)(c.Z,{children:"\u4fee\u590d"})," \u542f\u7528\u8bf7\u6c42 ",(0,s.jsx)(t.code,{children:"Body"})," \u91cd\u590d\u8bfb\u4e14\u5728\u6388\u6743\u4e4b\u524d\u8bfb\u53d6\u5bfc\u81f4\u975e ",(0,s.jsx)(t.code,{children:"GET/HEAD/OPTION"})," \u8bf7\u6c42\u5f02\u5e38 ",(0,s.jsx)("sup",{ch
|