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
63 KiB
JavaScript

"use strict";(self.webpackChunkfurion=self.webpackChunkfurion||[]).push([[7245],{8689:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>o,default:()=>x,frontMatter:()=>d,metadata:()=>t,toc:()=>a});var r=s(5893),i=s(1151),c=s(4996),l=s(510);const d={id:"serverun",title:"2.1 \u5165\u95e8\u6307\u5357",sidebar_label:"2.1 \u5165\u95e8\u6307\u5357",description:"\u5b66\u4e60 Furion \u5982\u4f55\u5feb\u901f\u5165\u95e8"},o=void 0,t={id:"serverun",title:"2.1 \u5165\u95e8\u6307\u5357",description:"\u5b66\u4e60 Furion \u5982\u4f55\u5feb\u901f\u5165\u95e8",source:"@site/docs/serverun.mdx",sourceDirName:".",slug:"/serverun",permalink:"/docs/serverun",draft:!1,unlisted:!1,editUrl:"https://gitee.com/dotnetchina/Furion/tree/v4/handbook/docs/serverun.mdx",tags:[],version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1698273195,formattedLastUpdatedAt:"Oct 25, 2023",frontMatter:{id:"serverun",title:"2.1 \u5165\u95e8\u6307\u5357",sidebar_label:"2.1 \u5165\u95e8\u6307\u5357",description:"\u5b66\u4e60 Furion \u5982\u4f55\u5feb\u901f\u5165\u95e8"},sidebar:"docs",previous:{title:"2. \u5165\u95e8\u6307\u5357",permalink:"/docs/category/getstart"},next:{title:"2.2 ASP.NET 5 \u96c6\u6210",permalink:"/docs/get-start-net5"}},h={},a=[{value:"2.1.1 \u5386\u53f2\u80cc\u666f",id:"211-\u5386\u53f2\u80cc\u666f",level:2},{value:"2.1.2 \u521b\u5efa <code>\u63a7\u5236\u53f0</code> \u9879\u76ee",id:"212-\u521b\u5efa-\u63a7\u5236\u53f0-\u9879\u76ee",level:2},{value:"2.1.3 \u6dfb\u52a0 <code>Furion</code> \u4f9d\u8d56\u5305",id:"213-\u6dfb\u52a0-furion-\u4f9d\u8d56\u5305",level:2},{value:"2.1.4 \u4e00\u53e5\u8bdd\u641e\u5b9a",id:"214-\u4e00\u53e5\u8bdd\u641e\u5b9a",level:2},{value:"2.1.5 \u542f\u52a8\u6d4f\u89c8\u5668",id:"215-\u542f\u52a8\u6d4f\u89c8\u5668",level:2},{value:"2.1.6 \u7f16\u5199\u7b2c\u4e00\u4e2a <code>API</code>",id:"216-\u7f16\u5199\u7b2c\u4e00\u4e2a-api",level:2},{value:"2.1.7 <code>Serve.Run()</code> \u66f4\u591a\u914d\u7f6e",id:"217-serverun-\u66f4\u591a\u914d\u7f6e",level:2},{value:"2.1.7.1 \u914d\u7f6e\u9ed8\u8ba4\u542f\u52a8\u5730\u5740/\u7aef\u53e3",id:"2171-\u914d\u7f6e\u9ed8\u8ba4\u542f\u52a8\u5730\u5740\u7aef\u53e3",level:3},{value:"2.1.7.2 \u4fbf\u6377\u670d\u52a1\u6ce8\u518c",id:"2172-\u4fbf\u6377\u670d\u52a1\u6ce8\u518c",level:3},{value:"2.1.7.3 \u81ea\u5b9a\u4e49\u914d\u7f6e",id:"2173-\u81ea\u5b9a\u4e49\u914d\u7f6e",level:3},{value:"2.1.7.4 <code>Serve.Run</code> \u548c <code>Startup</code> \u6700\u4f73\u7ec4\u5408",id:"2174-serverun-\u548c-startup-\u6700\u4f73\u7ec4\u5408",level:3},{value:"2.1.7.5 \u66f4\u591a\u914d\u7f6e",id:"2175-\u66f4\u591a\u914d\u7f6e",level:3},{value:"2.1.8 \u652f\u6301 <code>Furion</code> \u6240\u6709\u529f\u80fd",id:"218-\u652f\u6301-furion-\u6240\u6709\u529f\u80fd",level:2},{value:"2.1.8.1 \u6dfb\u52a0 <code>appsettings.json</code>",id:"2181-\u6dfb\u52a0-appsettingsjson",level:3},{value:"2.1.8.2 \u6dfb\u52a0\u81ea\u5b9a\u4e49 <code>Startup</code>",id:"2182-\u6dfb\u52a0\u81ea\u5b9a\u4e49-startup",level:3},{value:"2.1.8.3 \u5c06\u63a7\u5236\u53f0\u9879\u76ee\u53d8\u6210 <code>Web</code> \u9879\u76ee",id:"2183-\u5c06\u63a7\u5236\u53f0\u9879\u76ee\u53d8\u6210-web-\u9879\u76ee",level:3},{value:"2.1.8.4 \u6dfb\u52a0 <code>args</code> \u542f\u52a8\u53c2\u6570",id:"2184-\u6dfb\u52a0-args-\u542f\u52a8\u53c2\u6570",level:3},{value:"2.1.8.5 \u8fd8\u6ca1\u770b\u591f\uff1f",id:"2185-\u8fd8\u6ca1\u770b\u591f",level:3},{value:"2.1.9 <code>RunOptions</code>\uff0c<code>LegacyRunOptions</code> \u548c <code>GenericRunOptions</code>",id:"219-runoptionslegacyrunoptions-\u548c-genericrunoptions",level:2},{value:"2.1.10 \u5728 <code>WinForm/WPF/Console</code> \u4e2d\u4f7f\u7528",id:"2110-\u5728-winformwpfconsole-\u4e2d\u4f7f\u7528",level:2},{value:"2.1.10.1 <code>WinForm</code> \u521d\u59cb\u5316",id:"21101-winform-\u521d\u59cb\u5316",level:3},{value:"2.1.10.2 <code>WPF</code> \u521d\u59cb\u5316",id:"21102-wpf-\u521d\u59cb\u5316",level:3},{value:"2.1.10.3 <code>Console</code> \u521d\u59cb\u5316",id:"21103-console-\u521d\u59cb\u5316",level:3},{value:"2.1.10.4 \u6ce8\u518c\u670d\u52a1",id:"21104-\u6ce8\u518c\u670d\u52a1",level:3},{value:"2.1.11 \u9759\u9ed8\u542f\u52a8",id:"2111-\u9759\u9ed8\u542f\u52a8",level:2},{value:"2.1.12 <code>.NET5</code> \u6a21\u5f0f\u627e\u4e0d\u5230 <code>Views</code> \u89c6\u56fe\u8def\u5f84",id:"2112-net5-\u6a21\u5f0f\u627e\u4e0d\u5230-views-\u89c6\u56fe\u8def\u5f84",level:2},{value:"2.1.13 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"2113-\u53cd\u9988\u4e0e\u5efa\u8bae",level:2}];function u(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",hr:"hr",li:"li",mdxAdmonitionTitle:"mdxAdmonitionTitle",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components},{Details:s}=n;return s||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s,{children:[(0,r.jsx)("summary",{children:"\ud83d\udcdd \u6a21\u5757\u66f4\u65b0\u65e5\u5fd7"}),(0,r.jsx)("div",{children:(0,r.jsx)("div",{children:(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"\u65b0\u7279\u6027"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\xa0",(0,r.jsx)(l.Z,{children:"\u65b0\u589e"})," ",(0,r.jsx)(n.code,{children:"Serve.IdleHost"})," \u652f\u6301\u8fd4\u56de ",(0,r.jsx)(n.code,{children:"http"})," \u548c ",(0,r.jsx)(n.code,{children:"https"})," \u534f\u8bae ",(0,r.jsx)(n.code,{children:"Web"})," \u5730\u5740\uff08\u7aef\u53e3\uff09 ",(0,r.jsx)("sup",{children:"4.8.8"})," ",(0,r.jsx)("sup",{children:"\u23f1\ufe0f2023.04.13"})," ",(0,r.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/commit/fdf7885f282057599be6b1b3833373dd153db42a",children:"fdf7885"})]}),"\n",(0,r.jsxs)(n.li,{children:["\xa0",(0,r.jsx)(l.Z,{children:"\u65b0\u589e"})," ",(0,r.jsx)(n.code,{children:"Serve.GetIdleHost([host])"})," \u9759\u6001\u65b9\u6cd5\uff0c\u53ef\u83b7\u53d6\u4e00\u4e2a\u6307\u5b9a\u4e3b\u673a\u7684 ",(0,r.jsx)(n.code,{children:"Web"})," \u5730\u5740\uff08\u7aef\u53e3\uff09 ",(0,r.jsx)("sup",{children:"4.8.7.43"})," ",(0,r.jsx)("sup",{children:"\u23f1\ufe0f2023.04.12"})," ",(0,r.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/commit/fdf7885f282057599be6b1b3833373dd153db42a",children:"fdf788"})]}),"\n",(0,r.jsxs)(n.li,{children:["\xa0",(0,r.jsx)(l.Z,{children:"\u65b0\u589e"})," ",(0,r.jsx)(n.code,{children:"Serve.IdleHost"})," \u9759\u6001\u5c5e\u6027\uff0c\u53ef\u83b7\u53d6\u4e00\u4e2a\u968f\u673a\u7a7a\u95f2 ",(0,r.jsx)(n.code,{children:"Web"})," \u4e3b\u673a\u5730\u5740\uff08\u7aef\u53e3\uff09 ",(0,r.jsx)("sup",{children:"4.8.7.29"})," ",(0,r.jsx)("sup",{children:"\u23f1\ufe0f2023.03.30"})," ",(0,r.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/commit/e4250634246af612f052ec935416ee050b44d22e",children:"e425063"})]}),"\n",(0,r.jsxs)(n.li,{children:["\xa0",(0,r.jsx)(l.Z,{children:"\u65b0\u589e"})," ",(0,r.jsx)(n.code,{children:"WinForm/WPF"})," \u9759\u6001\u65b9\u6cd5 ",(0,r.jsx)(n.code,{children:"Serve.RunNative()"})," \u53ef\u914d\u7f6e\u662f\u5426\u542f\u7528 ",(0,r.jsx)(n.code,{children:"Web"})," \u4e3b\u673a\u529f\u80fd ",(0,r.jsx)("sup",{children:"4.8.7.26"})," ",(0,r.jsx)("sup",{children:"\u23f1\ufe0f2023.03.29"})," ",(0,r.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I6R97L",children:"#I6R97L"})]}),"\n",(0,r.jsxs)(n.li,{children:["\xa0",(0,r.jsx)(l.Z,{children:"\u65b0\u589e"})," ",(0,r.jsxs)(n.strong,{children:[(0,r.jsx)(n.code,{children:"WinForm/WPF"})," \u5feb\u901f\u6ce8\u518c\u9759\u6001\u65b9\u6cd5\uff1a",(0,r.jsx)(n.code,{children:"Serve.RunNative()"})]})," ",(0,r.jsx)("sup",{children:"4.8.7.23"})," ",(0,r.jsx)("sup",{children:"\u23f1\ufe0f2023.03.27"})," ",(0,r.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/commit/53d51c3645f4066f5d68d4726d78e389fd544560",children:"53d51c3"})]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"\u5176\u4ed6\u66f4\u6539"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\xa0",(0,r.jsx)(l.Z,{children:"\u8c03\u6574"})," ",(0,r.jsx)(n.code,{children:"Serve.Run()"})," \u8ff7\u4f60\u4e3b\u673a\u9ed8\u8ba4\u6dfb\u52a0 ",(0,r.jsx)(n.code,{children:"JSON"})," \u4e2d\u6587\u4e71\u7801\u5904\u7406 ",(0,r.jsx)("sup",{children:"4.8.6.3"})," ",(0,r.jsx)("sup",{children:"\u23f1\ufe0f2023.02.15"})," ",(0,r.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/commit/86b5f9f7c2ace503312bf879dccd7add12bd93c4",children:"86b5f9f"})]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"\u95ee\u9898\u4fee\u590d"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\xa0",(0,r.jsx)(l.Z,{children:"\u4fee\u590d"})," ",(0,r.jsx)(n.code,{children:"Serve.IdleHost"})," \u83b7\u53d6\u968f\u673a\u7aef\u53e3\u7684\u672c\u5730\u5730\u5740\u5e26 ",(0,r.jsx)(n.code,{children:"$"})," \u7b26\u53f7\u95ee\u9898 ",(0,r.jsx)("sup",{children:"4.8.8"})," ",(0,r.jsx)("sup",{children:"\u23f1\ufe0f2023.04.13"})," ",(0,r.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/commit/ed6f29263607f58fe0eafdf21dadfc33987309e1",children:"ed6f292"})]}),"\n",(0,r.jsxs)(n.li,{children:["\xa0",(0,r.jsx)(l.Z,{children:"\u4fee\u590d"})," ",(0,r.jsx)(n.code,{children:"Serve.Run()"})," \u56e0 ",(0,r.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I6G02W",children:"#I6G02W"})," \u66f4\u6539\u5bfc\u81f4\u4e0d\u914d\u7f6e\u7aef\u53e3\u65f6\u51fa\u73b0\u5f02\u5e38\u65e0\u6cd5\u542f\u52a8\u95ee\u9898 ",(0,r.jsx)("sup",{children:"4.8.6.10"})," ",(0,r.jsx)("sup",{children:"\u23f1\ufe0f2023.02.20"})," ",(0,r.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I6G6AR",children:"#I6G6AR"})]}),"\n",(0,r.jsxs)(n.li,{children:["\xa0",(0,r.jsx)(l.Z,{children:"\u4fee\u590d"})," ",(0,r.jsx)(n.code,{children:'Serve.Run(urls: "\u7aef\u53e3")'})," \u8bbe\u7f6e\u7aef\u53e3\u5728 ",(0,r.jsx)(n.code,{children:".NET6/7"})," \u4e0b\u53d1\u5e03\u540e\u59cb\u7ec8\u662f ",(0,r.jsx)(n.code,{children:"80"})," \u7aef\u53e3\u95ee\u9898 ",(0,r.jsx)("sup",{children:"4.8.6.6"})," ",(0,r.jsx)("sup",{children:"\u23f1\ufe0f2023.02.18"})," ",(0,r.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/I6G02W",children:"#I6G02W"})]}),"\n"]}),"\n"]}),"\n"]})})})]}),"\n",(0,r.jsx)(n.admonition,{title:"\u7248\u672c\u8bf4\u660e",type:"important",children:(0,r.jsxs)(n.p,{children:["\u4ee5\u4e0b\u5185\u5bb9\u4ec5\u9650 ",(0,r.jsx)(n.code,{children:"Furion 3.6.3 +"})," \u7248\u672c\u4f7f\u7528\u3002"]})}),"\n",(0,r.jsxs)(n.admonition,{title:"\u63a8\u8350\u4f7f\u7528\u811a\u624b\u67b6",type:"tip",children:[(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"Furion"})," \u5b98\u65b9\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u65b9\u4fbf\u7684\u811a\u624b\u67b6\uff0c\u53ef\u4ee5\u5feb\u901f\u7684\u521b\u5efa\u591a\u5c42\u67b6\u6784\u9879\u76ee\u3002"]}),(0,r.jsxs)(n.p,{children:["\u63a8\u8350\u4f7f\u7528 \u300a",(0,r.jsx)(n.a,{href:"/docs/template",children:"2.6 \u5b98\u65b9\u811a\u624b\u67b6"}),"\u300b\u4ee3\u66ff\u672c\u7ae0\u8282\u529f\u80fd\u3002"]})]}),"\n",(0,r.jsx)(n.h2,{id:"211-\u5386\u53f2\u80cc\u666f",children:"2.1.1 \u5386\u53f2\u80cc\u666f"}),"\n",(0,r.jsxs)(n.p,{children:["\u76f8\u4fe1\u4ece ",(0,r.jsx)(n.code,{children:"ASP.NET 5"})," \u5347\u7ea7\u81f3 ",(0,r.jsx)(n.code,{children:"ASP.NET 6"})," \u7684\u5f00\u53d1\u8005\u90fd\u7ecf\u5386\u8fc7\u8fd9\u6837\u53d8\u66f4\uff1a"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\u5728 ",(0,r.jsx)(n.code,{children:"ASP.NET 5"})," \u4e2d\uff0c\u6211\u4eec\u8fd9\u6837\u521b\u5efa ",(0,r.jsx)(n.code,{children:"Web \u4e3b\u673a"}),"\uff1a"]}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:'showLineNumbers {1} title="Program.cs"',children:"Host.CreateDefaultBuilder(args)\r\n .ConfigureWebHostDefaults(webBuilder =>\r\n {\r\n webBuilder.UseStartup<Startup>();\r\n });\n"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\u5728 ",(0,r.jsx)(n.code,{children:"ASP.NET 6"})," \u4e2d\uff0c \u6211\u4eec\u8fd9\u6837\u521b\u5efa ",(0,r.jsx)(n.code,{children:"Web \u4e3b\u673a"}),"\uff1a"]}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:'showLineNumbers {1} title="Program.cs"',children:"var builder = WebApplication.CreateBuilder(args);\r\nvar app = builder.Build();\n"})}),"\n",(0,r.jsxs)(n.p,{children:["\u8bd5\u95ee\uff0c",(0,r.jsx)(n.code,{children:"ASP.NET 7"}),"\uff0c",(0,r.jsx)(n.code,{children:"ASP.NET 8"})," ... ",(0,r.jsx)(n.code,{children:"ASP.NET N"})," \u5462\uff1f\u4f1a\u4e0d\u4f1a\u6bcf\u4e00\u4e2a\u7248\u672c\u90fd\u6709\u4e0d\u540c\u7684\u521b\u5efa\u65b9\u5f0f\uff0c\u90a3\u540e\u7eed\u9879\u76ee\u5982\u4f55\u65e0\u7f1d\u5347\u7ea7\uff1f"]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["\u6240\u4ee5\uff0c\u4e3a\u4e86\u4fdd\u8bc1\u4e00\u81f4\u7684\u4ee3\u7801\u4f53\u9a8c\u548c\u540e\u7eed\u65e0\u7f1d\u5347\u7ea7\uff0c\u63a8\u51fa\u4e86 ",(0,r.jsx)(n.code,{children:"Serve.Run()"}),"\uff0c\u5373\u4f7f\u672a\u6765\u521b\u5efa\u65b9\u5f0f\u53d8\u4e86\uff0c\u4e5f\u4e0d\u7528\u62c5\u5fc3\uff0c\u4ea4\u7ed9\u6846\u67b6\u5373\u53ef\u3002"]})}),"\n",(0,r.jsxs)(n.h2,{id:"212-\u521b\u5efa-\u63a7\u5236\u53f0-\u9879\u76ee",children:["2.1.2 \u521b\u5efa ",(0,r.jsx)(n.code,{children:"\u63a7\u5236\u53f0"})," \u9879\u76ee"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\u6253\u5f00 ",(0,r.jsx)(n.code,{children:"Visual Studio 2022"})," \u5e76\u521b\u5efa ",(0,r.jsx)(n.code,{children:"\u63a7\u5236\u53f0"})," \u9879\u76ee"]}),"\n"]}),"\n",(0,r.jsx)("img",{src:(0,c.Z)("img/01.png")}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"\u914d\u7f6e\u9879\u76ee\u540d\u79f0"}),"\n"]}),"\n",(0,r.jsx)("img",{src:(0,c.Z)("img/02.png")}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\u9009\u62e9 ",(0,r.jsx)(n.code,{children:".NET6"})]}),"\n"]}),"\n",(0,r.jsx)("img",{src:(0,c.Z)("img/03.png")}),"\n",(0,r.jsx)(n.admonition,{title:"\u4f7f\u7528\u547d\u4ee4\u884c\u65b9\u5f0f",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:"showLineNumbers",children:"// \u521b\u5efa\u63a7\u5236\u53f0\u9879\u76ee\r\ndotnet new console -n HelloFurion\n"})})}),"\n",(0,r.jsxs)(n.h2,{id:"213-\u6dfb\u52a0-furion-\u4f9d\u8d56\u5305",children:["2.1.3 \u6dfb\u52a0 ",(0,r.jsx)(n.code,{children:"Furion"})," \u4f9d\u8d56\u5305"]}),"\n",(0,r.jsx)("img",{src:(0,c.Z)("img/04.png")}),"\n",(0,r.jsx)(n.admonition,{title:"\u4f7f\u7528\u547d\u4ee4\u884c\u65b9\u5f0f",type:"tip",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:"showLineNumbers",children:"// \u8fdb\u5165\u521b\u5efa\u7684\u76ee\u5f55\r\ncd HelloFurion\r\n// \u6dfb\u52a0\u5305\r\ndotnet add package Furion\n"})})}),"\n",(0,r.jsx)(n.h2,{id:"214-\u4e00\u53e5\u8bdd\u641e\u5b9a",children:"2.1.4 \u4e00\u53e5\u8bdd\u641e\u5b9a"}),"\n",(0,r.jsxs)(n.p,{children:["\u4fee\u6539 ",(0,r.jsx)(n.code,{children:"Program.cs"})," \u4ee3\u7801\u4e3a\uff1a"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:'showLineNumbers title="Program.cs"',children:"Serve.Run();\n"})}),"\n",(0,r.jsxs)(n.p,{children:["\u5bf9\uff0c\u4f60\u6ca1\u770b\u9519\uff0c",(0,r.jsx)(n.code,{children:"Furion"})," \u5df2\u7ecf\u914d\u7f6e\u597d\u4e86\uff01"]}),"\n",(0,r.jsx)(n.admonition,{title:"\u529f\u80fd\u8bf4\u660e",type:"tip",children:(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"Serve.Run()"})," \u5df2\u7ecf\u5305\u542b\u4e86\u57fa\u672c\u7684 ",(0,r.jsx)(n.code,{children:"WebAPI"})," \u529f\u80fd\uff0c\u5305\u542b\u52a8\u6001 ",(0,r.jsx)(n.code,{children:"WebAPI"}),"\uff0c",(0,r.jsx)(n.code,{children:"\u8de8\u57df"})," \u7b49\u7b49\uff0c\u5982\u9700\u5b8c\u5168\u81ea\u5b9a\u4e49\u914d\u7f6e\u53ef\u4f7f\u7528 ",(0,r.jsx)(n.code,{children:"Serve.Run(RunOptions.Default)"}),"\uff0c\u4e4b\u540e ",(0,r.jsx)(n.code,{children:"AppStartup"})," \u6d3e\u751f\u7c7b\u81ea\u884c\u914d\u7f6e\u3002"]})}),"\n",(0,r.jsx)(n.h2,{id:"215-\u542f\u52a8\u6d4f\u89c8\u5668",children:"2.1.5 \u542f\u52a8\u6d4f\u89c8\u5668"}),"\n",(0,r.jsx)(n.p,{children:"\u542f\u52a8\u6d4f\u89c8\u5668\u67e5\u770b\u6548\u679c"}),"\n",(0,r.jsx)("img",{src:(0,c.Z)("img/05.png")}),"\n",(0,r.jsx)("img",{src:(0,c.Z)("img/06.png")}),"\n",(0,r.jsx)(n.p,{children:"\u662f\u4e0d\u662f\u8d85\u7ea7\u8d85\u7ea7\u7b80\u5355\uff01\uff01\uff01"}),"\n",(0,r.jsxs)(n.h2,{id:"216-\u7f16\u5199\u7b2c\u4e00\u4e2a-api",children:["2.1.6 \u7f16\u5199\u7b2c\u4e00\u4e2a ",(0,r.jsx)(n.code,{children:"API"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:'showLineNumbers title="Program.cs" {3,6}',children:'Serve.Run();\r\n\r\n[DynamicApiController]\r\npublic class HelloService\r\n{\r\n public string Say()\r\n {\r\n return "Hello, Furion";\r\n }\r\n}\n'})}),"\n",(0,r.jsx)(n.p,{children:"\u542f\u52a8\u6d4f\u89c8\u5668\u67e5\u770b\u6548\u679c"}),"\n",(0,r.jsx)("img",{src:(0,c.Z)("img/07.png")}),"\n",(0,r.jsxs)(n.h2,{id:"217-serverun-\u66f4\u591a\u914d\u7f6e",children:["2.1.7 ",(0,r.jsx)(n.code,{children:"Serve.Run()"})," \u66f4\u591a\u914d\u7f6e"]}),"\n",(0,r.jsx)(n.h3,{id:"2171-\u914d\u7f6e\u9ed8\u8ba4\u542f\u52a8\u5730\u5740\u7aef\u53e3",children:"2.1.7.1 \u914d\u7f6e\u9ed8\u8ba4\u542f\u52a8\u5730\u5740/\u7aef\u53e3"}),"\n",(0,r.jsxs)(n.p,{children:["\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u521b\u5efa\u7684 ",(0,r.jsx)(n.code,{children:"Web"})," \u4e3b\u673a\u7aef\u53e3\u4e3a ",(0,r.jsx)(n.code,{children:"5000/5001"})," \u7aef\u53e3\uff0c\u5982\u9700\u81ea\u5b9a\u4e49\u914d\u7f6e\uff0c\u53ef\u901a\u8fc7\u7b2c\u4e00\u4e2a\u53c2\u6570\u914d\u7f6e\uff1a"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers",children:'Serve.Run("https://localhost:8080");\r\n\r\n// \u6216\r\nServe.Run(RunOptions.Default, "https://localhost:8080");\n'})}),"\n",(0,r.jsxs)(n.p,{children:["\u540c\u65f6\u4e5f\u652f\u6301 ",(0,r.jsx)(n.code,{children:"dotnet run"})," \u548c ",(0,r.jsx)(n.code,{children:"dotnet watch run"})," \u6307\u5b9a\uff1a"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",metastring:"showLineNumbers",children:"dotnet run --urls https://localhost:8080\r\n\r\n# watch \u65b9\u5f0f\r\ndotnet watch run --urls https://localhost:8080\n"})}),"\n",(0,r.jsxs)(n.p,{children:["\u4e5f\u53ef\u4ee5\u901a\u8fc7 ",(0,r.jsx)(n.code,{children:"ConfigureBuilder"})," \u65b9\u5f0f\u914d\u7f6e\uff1a"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1,7}",children:'// .NET6+\r\nServe.Run(RunOptions.Default.ConfigureBuilder(builder =>\r\n{\r\n builder.WebHost.UseUrls("https://localhost:8080"); // \u4e5f\u53ef\u4ee5\u901a\u8fc7 builder.Configuration \u8bfb\u53d6 urls \u914d\u7f6e\r\n}));\r\n\r\n// .NET5\r\nServe.Run(RunOptions.ConfigureWebDefaults(webHostBuilder =>\r\n{\r\n return webHostBuilder.UseUrls("https://localhost:8080");\r\n}));\n'})}),"\n",(0,r.jsxs)(n.admonition,{type:"important",children:[(0,r.jsxs)(n.mdxAdmonitionTitle,{children:["\u5173\u4e8e ",(0,r.jsx)(n.code,{children:"localhost"})," \u548c\u591a\u7aef\u53e3"]}),(0,r.jsxs)(n.p,{children:["\u5efa\u8bae\u4f7f\u7528 ",(0,r.jsx)(n.code,{children:"*"})," \u4ee3\u66ff ",(0,r.jsx)(n.code,{children:"localhost"}),"\uff0c\u8fd9\u6837\u53ef\u4ee5\u81ea\u9002\u5e94\u4e3b\u673a\u5730\u5740\uff0c\u591a\u4e2a\u7aef\u53e3\u4f7f\u7528 ",(0,r.jsx)(n.code,{children:";"})," \u5206\u5272\uff0c\u7ed3\u5c3e\u65e0\u9700 ",(0,r.jsx)(n.code,{children:";"})]})]}),"\n",(0,r.jsxs)(n.admonition,{type:"tip",children:[(0,r.jsxs)(n.mdxAdmonitionTitle,{children:["\u901a\u8fc7 ",(0,r.jsx)(n.code,{children:"json"})," \u65b9\u5f0f\u914d\u7f6e"]}),(0,r.jsx)(n.p,{children:"\u5982\u9700\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e\u7aef\u53e3\uff0c\u9700\u4e24\u4e2a\u8be5\u6b65\u9aa4\uff1a"}),(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\u7f16\u8f91\u63a7\u5236\u53f0\u542f\u52a8\u9879\u76ee ",(0,r.jsx)(n.code,{children:".csproj"})," \u6587\u4ef6\uff0c\u4fee\u6539 ",(0,r.jsx)(n.code,{children:"Project"})," \u8282\u70b9\u4e3a\uff1a"]}),"\n"]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-xml",metastring:"showLineNumbers",children:'<Project Sdk="Microsoft.NET.Sdk.Web">\n'})}),(0,r.jsxs)(n.p,{children:["\u4e5f\u5c31\u662f\u5728\u539f\u6765\u7684 ",(0,r.jsx)(n.code,{children:"Sdk"})," \u4e2d\u6dfb\u52a0 ",(0,r.jsx)(n.code,{children:".Web"})," \u5373\u53ef\u3002"]}),(0,r.jsxs)(n.ol,{start:"2",children:["\n",(0,r.jsxs)(n.li,{children:["\u5728\u63a7\u5236\u53f0\u542f\u52a8\u9879\u76ee\u4e2d\u6dfb\u52a0 ",(0,r.jsx)(n.code,{children:"Properties"})," \u6587\u4ef6\u5939\u5e76\u5728\u6b64\u6587\u4ef6\u5939\u4e2d\u521b\u5efa ",(0,r.jsx)(n.code,{children:"launchSettings.json"})," \u6587\u4ef6\uff0c\u540c\u65f6\u5199\u5165\u4ee5\u4e0b\u5185\u5bb9\uff1a"]}),"\n"]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-json",metastring:'showLineNumbers {4,8} title="launchSettings.json"',children:'{\r\n "$schema": "http://json.schemastore.org/launchsettings.json",\r\n "profiles": {\r\n "\u542f\u52a8\u9879\u76ee\u540d\u79f0": {\r\n "commandName": "Project",\r\n "launchBrowser": true,\r\n "launchUrl": "",\r\n "applicationUrl": "https://localhost:8080;http://localhost:8081",\r\n "environmentVariables": {\r\n "ASPNETCORE_ENVIRONMENT": "Development"\r\n }\r\n }\r\n }\r\n}\n'})}),(0,r.jsxs)(n.p,{children:["\u9664\u4e86 ",(0,r.jsx)(n.code,{children:"launchsettings.json"})," \u7684\u65b9\u5f0f\uff0c\u8fd8\u53ef\u4ee5\u5728 ",(0,r.jsx)(n.code,{children:"appsettings.json"})," \u7b80\u5355\u914d\u7f6e"]}),(0,r.jsx)(n.hr,{}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-json",metastring:'showLineNumbers {2} title="appsettings.json"',children:'{\r\n "Urls": "http://localhost:8081"\r\n}\n'})})]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"\u8fd8\u53ef\u4ee5\u83b7\u53d6\u968f\u673a\u7a7a\u95f2\u7aef\u53e3\u542f\u52a8"}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{title:"\u7248\u672c\u8bf4\u660e",type:"important",children:(0,r.jsxs)(n.p,{children:["\u4ee5\u4e0b\u5185\u5bb9\u4ec5\u9650 ",(0,r.jsx)(n.code,{children:"Furion 4.8.7.29 +"})," \u7248\u672c\u4f7f\u7528\u3002"]})}),"\n",(0,r.jsxs)(n.p,{children:["\u901a\u8fc7 ",(0,r.jsx)(n.code,{children:"Serve.IdleHost"})," \u9759\u6001\u5c5e\u6027\u53ef\u4ee5\u83b7\u53d6\u968f\u673a\u7684 ",(0,r.jsx)(n.code,{children:"Web"})," \u4e3b\u673a\u5730\u5740\uff08\u7aef\u53e3\uff09\uff0c\u5982\uff1a",(0,r.jsx)(n.code,{children:"http://localhost:\u968f\u673a\u7aef\u53e3"}),"\u3002"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1,4-7,10-13}",children:'Serve.Run(urls: Serve.IdleHost.Urls);\r\n\r\n// \u5b8c\u6574\u8fd4\u56de\u503c\r\nvar idleHost = Serve.IdleHost;\r\nvar port = idleHost.Port; // => 44322\r\nvar urls = idleHost.Urls; // => http://localhost:44322\r\nvar ssl_urls = idleHost.SSL_Urls; // => https://localhost:44322\uff0cFurion 4.8.7.43+ \u652f\u6301\r\n\r\n// \u6307\u5b9a\u4e3b\u673a\u540d\uff0cFurion 4.8.7.43+ \u652f\u6301\r\nvar idleHost = Serve.GetIdleHost("furion.baiqian.ltd"); // \u4e0d\u4f20\u53c2\u6570\u9ed8\u8ba4 localhost\r\nvar port = idleHost.Port; // => 44322\r\nvar urls = idleHost.Urls; // => http://furion.baiqian.ltd:44322\r\nvar ssl_urls = idleHost.SSL_Urls; // => http://furion.baiqian.ltd:44322\n'})}),"\n",(0,r.jsx)(n.h3,{id:"2172-\u4fbf\u6377\u670d\u52a1\u6ce8\u518c",children:"2.1.7.2 \u4fbf\u6377\u670d\u52a1\u6ce8\u518c"}),"\n",(0,r.jsx)(n.admonition,{title:"\u7248\u672c\u8bf4\u660e",type:"important",children:(0,r.jsxs)(n.p,{children:["\u4ee5\u4e0b\u5185\u5bb9\u4ec5\u9650 ",(0,r.jsx)(n.code,{children:"Furion 4.8.0 +"})," \u7248\u672c\u4f7f\u7528\u3002"]})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1,7,13,19}",children:"Serve.Run(additional: services =>\r\n{\r\n services.AddRemoteRequest();\r\n});\r\n\r\n// \u901a\u7528\u6cdb\u578b\u4e3b\u673a\u65b9\u5f0f\r\nServe.RunGeneric(additional: services =>\r\n{\r\n services.AddRemoteRequest();\r\n});\r\n\r\n// \u8fd8\u53ef\u4ee5\u7701\u53bb additional\r\nServe.Run(services =>\r\n{\r\n services.AddRemoteRequest();\r\n});\r\n\r\n// \u901a\u7528\u6cdb\u578b\u4e3b\u673a\u65b9\u5f0f\r\nServe.RunGeneric(services =>\r\n{\r\n services.AddRemoteRequest();\r\n});\n"})}),"\n",(0,r.jsx)(n.h3,{id:"2173-\u81ea\u5b9a\u4e49\u914d\u7f6e",children:"2.1.7.3 \u81ea\u5b9a\u4e49\u914d\u7f6e"}),"\n",(0,r.jsxs)(n.p,{children:["\u4f20\u5165 ",(0,r.jsx)(n.code,{children:"RunOptions"})," \u5bf9\u8c61\u76f8\u5f53\u4e8e\u81ea\u7531\u5b9a\u4e49\u548c\u63a7\u5236\uff0c\u4e5f\u5c31\u662f\u9664\u4e86\u9ed8\u8ba4\u96c6\u6210\u4e86 ",(0,r.jsx)(n.code,{children:"Furion"})," \u4ee5\u5916\uff0c\u6ca1\u6709\u6ce8\u518c\u4efb\u4f55\u529f\u80fd\u3002"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["\u4ec5\u96c6\u6210 ",(0,r.jsx)(n.code,{children:"Furion"})," \u7684\u9ed8\u8ba4\u914d\u7f6e"]}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers",children:"Serve.Run(RunOptions.Default);\n"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"\u914d\u7f6e\u66f4\u591a\u670d\u52a1/\u4e2d\u95f4\u4ef6"}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1,2,7}",children:"Serve.Run(RunOptions.Default\r\n .ConfigureBuilder(builder =>\r\n {\r\n builder.Services.AddControllers()\r\n .AddInject();\r\n })\r\n .Configure(app =>\r\n {\r\n app.UseRouting();\r\n app.UseInject(string.Empty);\r\n app.UseEndpoints(endpoints =>\r\n {\r\n endpoints.MapControllers();\r\n });\r\n }));\n"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"WebComponent"})," \u65b9\u5f0f"]}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{title:"\u7248\u672c\u8bf4\u660e",type:"important",children:(0,r.jsxs)(n.p,{children:["\u4ee5\u4e0b\u5185\u5bb9\u4ec5\u9650 ",(0,r.jsx)(n.code,{children:"Furion 4.3.5 +"})," \u7248\u672c\u4f7f\u7528\u3002"]})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {2,4,6}",children:"Serve.Run(RunOptions.Default\r\n .AddWebComponent<XXXWebComponent>());\r\n\r\npublic class XXXWebComponent : IWebComponent\r\n{\r\n public void Load(WebApplicationBuilder builder, ComponentContext componentContext)\r\n {\r\n // ....\r\n }\r\n}\n"})}),"\n",(0,r.jsxs)(n.h3,{id:"2174-serverun-\u548c-startup-\u6700\u4f73\u7ec4\u5408",children:["2.1.7.4 ",(0,r.jsx)(n.code,{children:"Serve.Run"})," \u548c ",(0,r.jsx)(n.code,{children:"Startup"})," \u6700\u4f73\u7ec4\u5408"]}),"\n",(0,r.jsxs)(n.p,{children:["\u9ed8\u8ba4\u60c5\u51b5\u4e0b ",(0,r.jsx)(n.code,{children:"Serve.Run()"})," \u5185\u7f6e\u4e86 ",(0,r.jsx)(n.code,{children:"\u8de8\u57df"}),"\uff0c",(0,r.jsx)(n.code,{children:"\u63a7\u5236\u5668"}),"\uff0c",(0,r.jsx)(n.code,{children:"\u8def\u7531"}),"\uff0c",(0,r.jsx)(n.code,{children:"\u89c4\u8303\u5316\u7ed3\u679c"}),"\u3001",(0,r.jsx)(n.code,{children:"\u9759\u6001\u6587\u4ef6"})," \u670d\u52a1/\u4e2d\u95f4\u4ef6\u3002\u9002\u5408\u5feb\u901f\u5f00\u59cb\u9879\u76ee\u548c\u7f16\u5199\u6d4b\u8bd5\u4ee3\u7801\u3002"]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"\u4f46\u4e0d\u80fd\u5bf9\u8fd9\u4e9b\u5df2\u6ce8\u518c\u670d\u52a1/\u4e2d\u95f4\u4ef6\u8fdb\u884c\u81ea\u5b9a\u4e49\u914d\u7f6e"}),"\uff0c\u8fd9\u65f6\u53ea\u9700\u8981\u914d\u7f6e ",(0,r.jsx)(n.code,{children:"RunOptions"})," \u5c5e\u6027/\u65b9\u6cd5\u5373\u53ef\uff0c\u5982\uff1a"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:'showLineNumbers title="Program.cs"',children:"Serve.Run(RunOptions.Default\r\n .ConfigureBuilder(...)\r\n .Configure(..));\n"})}),"\n",(0,r.jsxs)(n.p,{children:["**\u4f46\u628a\u6240\u6709\u670d\u52a1/\u4e2d\u95f4\u4ef6\u90fd\u653e\u5728 ",(0,r.jsx)(n.code,{children:"Program.cs"})," \u4e2d\u597d\u5417\uff1f**\u7b54\u6848\u662f\u4e0d\u597d\u7684\uff0c\u56e0\u4e3a\u4f1a\u5bfc\u81f4\u540e\u7eed\u8fc1\u79fb\u4ee3\u7801\u7ef4\u62a4\u4ee3\u7801\u9020\u6210\u4e86\u4e00\u4e9b\u56f0\u6270\u3002"]}),"\n",(0,r.jsxs)(n.p,{children:["\u6240\u4ee5 ",(0,r.jsx)(n.code,{children:"Furion"})," \u63a8\u8350\u4e0b\u9762\u66f4\u52a0\u7075\u6d3b\u4e14\u6613\u7ef4\u62a4\u7684\u65b9\u5f0f\uff0c",(0,r.jsx)(n.code,{children:"Program.cs"})," \u53ea\u9700\u4e00\u53e5\u8bdd\u5373\u53ef\uff1a"]}),"\n",(0,r.jsxs)(n.admonition,{title:"\u63a8\u8350\u4f7f\u7528\u7ec4\u4ef6\u542f\u52a8",type:"tip",children:[(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"Furion 3.7.3+"})," \u5b98\u65b9\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u65b9\u4fbf\u7684\u7ec4\u4ef6\u5316\u542f\u52a8\u914d\u7f6e\u670d\u52a1\u3002"]}),(0,r.jsxs)(n.p,{children:["\u63a8\u8350\u4f7f\u7528 \u300a",(0,r.jsx)(n.a,{href:"./component",children:"3.1 \u7ec4\u4ef6\u5316\u542f\u52a8"}),"\u300b\u4ee3\u66ff ",(0,r.jsx)(n.code,{children:"AppStartup"})," \u65b9\u5f0f\u529f\u80fd\u3002"]})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:'showLineNumbers title="Program.cs"',children:"Serve.Run(RunOptions.Default);\n"})}),"\n",(0,r.jsxs)(n.p,{children:["\u7136\u540e\u6dfb\u52a0\u81ea\u5b9a\u4e49 ",(0,r.jsx)(n.code,{children:"Startup.cs"})," \u6587\u4ef6\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:'showLineNumbers {8,10,15} title="Startup.cs"',children:"using Furion;\r\nusing Microsoft.AspNetCore.Builder;\r\nusing Microsoft.AspNetCore.Hosting;\r\nusing Microsoft.Extensions.DependencyInjection;\r\n\r\nnamespace HelloFurion;\r\n\r\npublic class Startup : AppStartup\r\n{\r\n public void ConfigureServices(IServiceCollection services)\r\n {\r\n // ....\r\n }\r\n\r\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\r\n {\r\n // ....\r\n }\r\n}\n"})}),"\n",(0,r.jsx)(n.admonition,{title:"\u5c0f\u63d0\u793a",type:"tip",children:(0,r.jsxs)(n.p,{children:["\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u81ea\u5b9a\u4e49 ",(0,r.jsx)(n.code,{children:"Startup.cs"})," \u6587\u4ef6\u5e94\u8be5\u653e\u5728\u72ec\u7acb\u7684 ",(0,r.jsx)(n.code,{children:"YourProject.Web.Core"})," \u5c42\u6216\u5176\u4ed6\u5c42\u3002"]})}),"\n",(0,r.jsx)(n.h3,{id:"2175-\u66f4\u591a\u914d\u7f6e",children:"2.1.7.5 \u66f4\u591a\u914d\u7f6e"}),"\n",(0,r.jsxs)(n.p,{children:["\u5982\u914d\u7f6e ",(0,r.jsx)(n.code,{children:"WebHost"}),"..."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers",children:"Serve.Run(RunOptions.Default\r\n .ConfigureBuilder(builder => {\r\n builder.WebHost.....\r\n }));\n"})}),"\n",(0,r.jsxs)(n.h2,{id:"218-\u652f\u6301-furion-\u6240\u6709\u529f\u80fd",children:["2.1.8 \u652f\u6301 ",(0,r.jsx)(n.code,{children:"Furion"})," \u6240\u6709\u529f\u80fd"]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"Serve.Run()"})," \u770b\u4f3c\u975e\u5e38\u7b80\u5355\uff0c\u5b9e\u5219\u975e\u5e38\u7075\u6d3b\uff0c\u800c\u4e14\u652f\u6301 ",(0,r.jsx)(n.code,{children:"Furion"})," \u548c ",(0,r.jsx)(n.code,{children:".NET"})," \u6240\u6709\u529f\u80fd\u3002"]}),"\n",(0,r.jsxs)(n.h3,{id:"2181-\u6dfb\u52a0-appsettingsjson",children:["2.1.8.1 \u6dfb\u52a0 ",(0,r.jsx)(n.code,{children:"appsettings.json"})]}),"\n",(0,r.jsxs)(n.p,{children:["\u521b\u5efa ",(0,r.jsx)(n.code,{children:"appsettings.json"})," \u6587\u4ef6\uff0c\u5e76\u8bbe\u7f6e ",(0,r.jsx)(n.code,{children:"\u5c5e\u6027"})," \u4e3a ",(0,r.jsx)(n.code,{children:"\u5982\u679c\u8f83\u65b0\u5219\u590d\u5236"})," \u548c ",(0,r.jsx)(n.code,{children:"\u5185\u5bb9"}),"\uff08\u751f\u6210\u64cd\u4f5c\uff09"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-json",metastring:"showLineNumbers",children:'{\r\n "Logging": {\r\n "LogLevel": {\r\n "Default": "Information",\r\n "Microsoft": "Warning",\r\n "Microsoft.Hosting.Lifetime": "Information",\r\n "Microsoft.EntityFrameworkCore": "Information"\r\n }\r\n },\r\n "AllowedHosts": "*"\r\n}\n'})}),"\n",(0,r.jsx)(n.p,{children:"\u5728\u4ee3\u7801\u4e2d\u8bfb\u53d6\u914d\u7f6e\uff1a"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {10}",children:'using Furion;\r\n\r\nServe.Run();\r\n\r\n[DynamicApiController]\r\npublic class HelloService\r\n{\r\n public string Say()\r\n {\r\n return "Hello, Furion " + App.Configuration["Logging:LogLevel:Default"];\r\n }\r\n}\n'})}),"\n",(0,r.jsx)("img",{src:(0,c.Z)("img/08.png")}),"\n",(0,r.jsxs)(n.h3,{id:"2182-\u6dfb\u52a0\u81ea\u5b9a\u4e49-startup",children:["2.1.8.2 \u6dfb\u52a0\u81ea\u5b9a\u4e49 ",(0,r.jsx)(n.code,{children:"Startup"})]}),"\n",(0,r.jsxs)(n.p,{children:["\u5728 ",(0,r.jsx)(n.code,{children:"Furion"})," \u4e2d\u53ef\u4ee5\u6d3e\u751f\u81ea ",(0,r.jsx)(n.code,{children:"AppStartup"})," \u53ef\u4ee5\u5b9e\u73b0\u66f4\u591a\u914d\u7f6e\uff0c\u5982\uff1a"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:'showLineNumbers title="Program.cs"',children:"Serve.Run();\n"})}),"\n",(0,r.jsx)(n.admonition,{title:"\u7279\u522b\u6ce8\u610f",type:"important",children:(0,r.jsxs)(n.p,{children:["\u5982\u679c\u60a8\u60f3\u81ea\u5df1\u914d\u7f6e ",(0,r.jsx)(n.code,{children:"Web"})," \u9879\u76ee\u670d\u52a1\uff0c\u53ef\u901a\u8fc7 ",(0,r.jsx)(n.code,{children:"Serve.Run(RunOptions.Default);"})," \u65b9\u5f0f\uff0c\u56e0\u4e3a ",(0,r.jsx)(n.code,{children:"Serve.Run()"})," \u5df2\u7ecf\u5305\u542b\u4e86\u5e38\u7528\u7684 ",(0,r.jsx)(n.code,{children:"Web"})," \u53ef\u80fd\u4f1a\u63d0\u793a\u91cd\u590d\u6ce8\u518c\u9519\u8bef\u3002"]})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:'showLineNumbers {8,10,12,15,17} title="MyStartup.cs"',children:'using Furion;\r\nusing Microsoft.AspNetCore.Builder;\r\nusing Microsoft.AspNetCore.Hosting;\r\nusing Microsoft.Extensions.DependencyInjection;\r\n\r\nnamespace HelloFurion;\r\n\r\npublic class MyStartup : AppStartup\r\n{\r\n public void ConfigureServices(IServiceCollection services)\r\n {\r\n Console.WriteLine("\u8c03\u7528\u670d\u52a1\u6ce8\u518c\u5566~~");\r\n }\r\n\r\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\r\n {\r\n Console.WriteLine("\u8c03\u7528\u4e2d\u95f4\u4ef6\u6ce8\u518c\u5566");\r\n }\r\n}\n'})}),"\n",(0,r.jsx)("img",{src:(0,c.Z)("img/09.png")}),"\n",(0,r.jsxs)(n.h3,{id:"2183-\u5c06\u63a7\u5236\u53f0\u9879\u76ee\u53d8\u6210-web-\u9879\u76ee",children:["2.1.8.3 \u5c06\u63a7\u5236\u53f0\u9879\u76ee\u53d8\u6210 ",(0,r.jsx)(n.code,{children:"Web"})," \u9879\u76ee"]}),"\n",(0,r.jsxs)(n.p,{children:["\u53ea\u9700\u8981\u7f16\u8f91 ",(0,r.jsx)(n.code,{children:".csproj"})," \u6587\u4ef6\uff0c\u5c06\u7b2c\u4e00\u884c ",(0,r.jsx)(n.code,{children:"Project"})," \u8282\u70b9\u7684 ",(0,r.jsx)(n.code,{children:"Sdk"})]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-xml",metastring:"showLineNumbers",children:'<Project Sdk="Microsoft.NET.Sdk">\n'})}),"\n",(0,r.jsx)(n.p,{children:"\u4fee\u6539\u4e3a\uff1a"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-xml",metastring:"showLineNumbers",children:'<Project Sdk="Microsoft.NET.Sdk.Web">\n'})}),"\n",(0,r.jsxs)(n.p,{children:["\u5373\u53ef\u5b8c\u6210\u8f6c\u6362\uff0c\u5b9e\u9645\u4e0a\u53ea\u662f\u8ffd\u52a0\u4e86 ",(0,r.jsx)(n.code,{children:".Web"}),"\u3002"]}),"\n",(0,r.jsxs)(n.h3,{id:"2184-\u6dfb\u52a0-args-\u542f\u52a8\u53c2\u6570",children:["2.1.8.4 \u6dfb\u52a0 ",(0,r.jsx)(n.code,{children:"args"})," \u542f\u52a8\u53c2\u6570"]}),"\n",(0,r.jsx)(n.admonition,{title:"\u7248\u672c\u8bf4\u660e",type:"important",children:(0,r.jsxs)(n.p,{children:["\u4ee5\u4e0b\u5185\u5bb9\u4ec5\u9650 ",(0,r.jsx)(n.code,{children:"Furion 4.2.4 +"})," \u7248\u672c\u4f7f\u7528\u3002"]})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1,3,5}",children:"Serve.Run(args: args);\r\n\r\nServe.Run(RunOptions.Default.WithArgs(args));\r\n\r\nServe.Run(RunOptions.Main(args));\n"})}),"\n",(0,r.jsx)(n.h3,{id:"2185-\u8fd8\u6ca1\u770b\u591f",children:"2.1.8.5 \u8fd8\u6ca1\u770b\u591f\uff1f"}),"\n",(0,r.jsxs)(n.p,{children:["\u662f\u4e0d\u662f\u975e\u5e38\u5f3a\u5927\u554a\uff0c",(0,r.jsx)(n.code,{children:"Serve.Run()"})," \u867d\u7136\u7b80\u5355\uff0c\u4f46\u662f 100% \u652f\u6301 ",(0,r.jsx)(n.code,{children:"Furion"})," \u548c ",(0,r.jsx)(n.code,{children:".NET"})," \u6240\u6709\u529f\u80fd\u3002\u5c3d\u60c5\u53bb\u4f53\u9a8c\u5427\uff01"]}),"\n",(0,r.jsxs)(n.h2,{id:"219-runoptionslegacyrunoptions-\u548c-genericrunoptions",children:["2.1.9 ",(0,r.jsx)(n.code,{children:"RunOptions"}),"\uff0c",(0,r.jsx)(n.code,{children:"LegacyRunOptions"})," \u548c ",(0,r.jsx)(n.code,{children:"GenericRunOptions"})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"Serve.Run"})," \u63d0\u4f9b\u4e86 ",(0,r.jsx)(n.code,{children:"RunOptions"}),"\uff0c",(0,r.jsx)(n.code,{children:"LegacyRunOptions"})," \u548c ",(0,r.jsx)(n.code,{children:"GenericRunOptions"})," \u91cd\u8f7d\u53c2\u6570\u7c7b\u578b\uff0c\u4ed6\u4eec\u7684\u4e3b\u8981\u533a\u522b\uff1a"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"RunOptions"}),"\uff1a\u4f7f\u7528\u7684\u662f ",(0,r.jsx)(n.code,{children:"WebApplication"})," \u65b9\u5f0f\uff0c",(0,r.jsxs)(n.strong,{children:["\u521b\u5efa ",(0,r.jsx)(n.code,{children:"Web"})," \u4e3b\u673a\u4f18\u5148\u63a8\u8350\u65b9\u5f0f"]})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"LegacyRunOptions"}),"\uff1a\u4f7f\u7528\u7684\u662f ",(0,r.jsx)(n.code,{children:"Host"})," \u65b9\u5f0f\uff0c\u4f46\u9ed8\u8ba4\u914d\u7f6e\u4e86 ",(0,r.jsx)(n.code,{children:"Web"})," \u4e3b\u673a"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"GenericRunOptions"}),"\uff1a\u4f7f\u7528\u7684\u662f ",(0,r.jsx)(n.code,{children:"Host"})," \u65b9\u5f0f\uff0c\u901a\u7528\u7c7b\u578b\u4e3b\u673a\uff0c\u53ef\u7528\u4e8e ",(0,r.jsx)(n.code,{children:"WorkerService"})]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"LegacyRunOptions"})," \u914d\u7f6e\u4f8b\u5b50\uff1a"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {5-6,15-16}",children:"using Microsoft.AspNetCore.Hosting;\r\nusing Microsoft.Extensions.DependencyInjection;\r\n\r\nServe.Run(LegacyRunOptions.Default\r\n // \u914d\u7f6e Web \u4e3b\u673a\r\n .ConfigureWebDefaults(builder => builder.ConfigureServices(services =>\r\n {\r\n // ...\r\n })\r\n .Configure(app =>\r\n {\r\n // ...\r\n });\r\n })\r\n // \u914d\u7f6e Host \u4e3b\u673a\r\n .ConfigureBuilder(builder => builder....));\n"})}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"GenericRunOptions"})," \u914d\u7f6e\u4f8b\u5b50\uff1a"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {2-3}",children:"Serve.Run(GenericRunOptions.Default\r\n // \u914d\u7f6e Host \u4e3b\u673a\r\n .ConfigureBuilder(hostBuilder => hostBuilder....);\n"})}),"\n",(0,r.jsxs)(n.p,{children:["\u66f4\u591a\u53d1\u5e03\u547d\u4ee4\u8bf4\u660e\u53ef\u67e5\u9605\u5fae\u8f6f\u5b98\u65b9\u6587\u6863 ",(0,r.jsx)(n.a,{href:"https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish",children:"https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish"})]}),"\n",(0,r.jsxs)(n.h2,{id:"2110-\u5728-winformwpfconsole-\u4e2d\u4f7f\u7528",children:["2.1.10 \u5728 ",(0,r.jsx)(n.code,{children:"WinForm/WPF/Console"})," \u4e2d\u4f7f\u7528"]}),"\n",(0,r.jsxs)(n.p,{children:["\u5728 ",(0,r.jsx)(n.code,{children:"WinForm"})," \u6216 ",(0,r.jsx)(n.code,{children:"WPF"})," \u6216 ",(0,r.jsx)(n.code,{children:"Console"})," \u4e2d\u4f7f\u7528\uff0c\u8bf7\u786e\u4fdd ",(0,r.jsx)(n.code,{children:"Serve.RunNative()"})," \u5728\u5e94\u7528\u7a0b\u5e8f\u4e4b\u524d\u521d\u59cb\u5316\uff1a"]}),"\n",(0,r.jsxs)(n.h3,{id:"21101-winform-\u521d\u59cb\u5316",children:["2.1.10.1 ",(0,r.jsx)(n.code,{children:"WinForm"})," \u521d\u59cb\u5316"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {3,8}",children:"namespace WinFormsApp2;\r\n\r\ninternal static class Program\r\n{\r\n [STAThread]\r\n static void Main()\r\n {\r\n Serve.RunNative(); // Furion 4.8.7.26+ \u652f\u6301\r\n\r\n ApplicationConfiguration.Initialize();\r\n Application.Run(new Form1());\r\n }\r\n}\n"})}),"\n",(0,r.jsxs)(n.admonition,{type:"tip",children:[(0,r.jsxs)(n.mdxAdmonitionTitle,{children:[(0,r.jsx)(n.code,{children:"Serve.RunNative"})," \u7aef\u53e3\u5360\u7528\u95ee\u9898"]}),(0,r.jsxs)(n.p,{children:["\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",(0,r.jsx)(n.code,{children:"Serve.RunNative()"})," \u4f1a\u542f\u52a8\u4e00\u4e2a\u8ff7\u4f60\u5c0f\u578b ",(0,r.jsx)(n.code,{children:"Web"})," \u4e3b\u673a\uff0c\u9ed8\u8ba4\u7aef\u53e3\u4e3a ",(0,r.jsx)(n.code,{children:"5000"}),"\uff0c\u5982\u65e0\u9700 ",(0,r.jsx)(n.code,{children:"Web"})," \u529f\u80fd\u53ef\u914d\u7f6e ",(0,r.jsx)(n.code,{children:"includeWeb"})," \u5173\u95ed\uff0c\u5982\uff1a"]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {2,5,8,11}",children:'// \u5173\u95ed\u8ff7\u4f60 Web \u4e3b\u673a\u529f\u80fd\r\nServe.RunNative(includeWeb: false);\r\n\r\n// \u6216\u66f4\u6362\u8ff7\u4f60 Web \u4e3b\u673a\u7aef\u53e3\r\nServe.RunNative(urls: "http://localhost:8080");\r\n\r\n// \u8fd8\u53ef\u4ee5\u5b8c\u5168\u81ea\u5b9a\u4e49\u914d\u7f6e Web \u4e3b\u673a\r\nServe.RunNative(RunOptions.Default);\r\n\r\n// \u8fd8\u53ef\u4ee5\u968f\u673a\u83b7\u53d6\u4e00\u4e2a\u7a7a\u95f2\u4e3b\u673a\u7aef\u53e3\uff08\u63a8\u8350\uff09\r\nServe.RunNative(urls: Serve.IdleHost.Urls);\n'})})]}),"\n",(0,r.jsxs)(n.h3,{id:"21102-wpf-\u521d\u59cb\u5316",children:["2.1.10.2 ",(0,r.jsx)(n.code,{children:"WPF"})," \u521d\u59cb\u5316"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {3,7}",children:"namespace WpfApp1;\r\n\r\npublic partial class App : Application\r\n{\r\n public App()\r\n {\r\n Serve.RunNative(); // Furion 4.8.7.23+\r\n }\r\n}\n"})}),"\n",(0,r.jsxs)(n.admonition,{type:"tip",children:[(0,r.jsxs)(n.mdxAdmonitionTitle,{children:[(0,r.jsx)(n.code,{children:"Serve.RunNative"})," \u7aef\u53e3\u5360\u7528\u95ee\u9898"]}),(0,r.jsxs)(n.p,{children:["\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",(0,r.jsx)(n.code,{children:"Serve.RunNative()"})," \u4f1a\u542f\u52a8\u4e00\u4e2a\u8ff7\u4f60\u5c0f\u578b ",(0,r.jsx)(n.code,{children:"Web"})," \u4e3b\u673a\uff0c\u9ed8\u8ba4\u7aef\u53e3\u4e3a ",(0,r.jsx)(n.code,{children:"5000"}),"\uff0c\u5982\u65e0\u9700 ",(0,r.jsx)(n.code,{children:"Web"})," \u529f\u80fd\u53ef\u914d\u7f6e ",(0,r.jsx)(n.code,{children:"includeWeb"})," \u5173\u95ed\uff0c\u5982\uff1a"]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {2,5,8,11}",children:'// \u5173\u95ed\u8ff7\u4f60 Web \u4e3b\u673a\u529f\u80fd\r\nServe.RunNative(includeWeb: false);\r\n\r\n// \u6216\u66f4\u6362\u8ff7\u4f60 Web \u4e3b\u673a\u7aef\u53e3\r\nServe.RunNative(urls: "http://localhost:8080");\r\n\r\n// \u8fd8\u53ef\u4ee5\u5b8c\u5168\u81ea\u5b9a\u4e49\u914d\u7f6e Web \u4e3b\u673a\r\nServe.RunNative(RunOptions.Default);\r\n\r\n// \u8fd8\u53ef\u4ee5\u968f\u673a\u83b7\u53d6\u4e00\u4e2a\u7a7a\u95f2\u4e3b\u673a\u7aef\u53e3\uff08\u63a8\u8350\uff09\r\nServe.RunNative(urls: Serve.IdleHost.Urls);\n'})})]}),"\n",(0,r.jsxs)(n.h3,{id:"21103-console-\u521d\u59cb\u5316",children:["2.1.10.3 ",(0,r.jsx)(n.code,{children:"Console"})," \u521d\u59cb\u5316"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {2}",children:'Console.WriteLine("Hello World");\r\nServe.RunNative(); // Furion 4.8.7.23+\r\nConsole.ReadKey();\n'})}),"\n",(0,r.jsx)(n.h3,{id:"21104-\u6ce8\u518c\u670d\u52a1",children:"2.1.10.4 \u6ce8\u518c\u670d\u52a1"}),"\n",(0,r.jsx)(n.p,{children:"\u5982\u679c\u60f3\u6ce8\u518c\u670d\u52a1\uff0c\u652f\u6301\u4ee5\u4e0b\u4e24\u79cd\u65b9\u5f0f\uff1a"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"Serve.RunNative"})," \u65b9\u5f0f"]}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1,3}",children:"Serve.RunNative(services =>\r\n{\r\n services.AddRemoteRequest();\r\n});\n"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"Startup.cs"})," \u65b9\u5f0f"]}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {2,4}",children:"// \u5728\u8ff7\u4f60 Web \u4e3b\u673a\u57fa\u7840\u4e0a\u81ea\u5b9a\u4e49\r\nServe.RunNative();\r\n\r\n// \u6216\u5b8c\u5168\u81ea\u5b9a\u4e49\r\nServe.RunNative(RunOptions.Default);\n"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:'showLineNumbers {6,8,10} title="YourStartup.cs"',children:"using Furion;\r\nusing Microsoft.Extensions.DependencyInjection;\r\n\r\nnamespace YourProject;\r\n\r\npublic class YourStartup : AppStartup\r\n{\r\n public void ConfigureServices(IServiceCollection services)\r\n {\r\n services.AddRemoteRequest();\r\n }\r\n}\n"})}),"\n",(0,r.jsx)(n.h2,{id:"2111-\u9759\u9ed8\u542f\u52a8",children:"2.1.11 \u9759\u9ed8\u542f\u52a8"}),"\n",(0,r.jsxs)(n.p,{children:["\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",(0,r.jsx)(n.code,{children:"Serve.Run()"})," \u4f7f\u7528\u963b\u585e\u7ebf\u7a0b\u65b9\u5f0f\u542f\u52a8\uff0c\u4f46\u6709\u4e9b\u65f6\u5019\u6211\u4eec\u4e0d\u5e0c\u671b\u963b\u585e\u73b0\u6709\u7684\u4ee3\u7801\uff0c\u53ef\u4f7f\u7528",(0,r.jsx)(n.strong,{children:"\u9759\u9ed8\u542f\u52a8"}),"\u7684\u65b9\u5f0f\uff1a"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {1}",children:'Serve.Run(silence: true);\r\n\r\nConsole.WriteLine("Hello, World!");\r\nConsole.ReadKey();\n'})}),"\n",(0,r.jsxs)(n.p,{children:["\u4e5f\u53ef\u4ee5\u901a\u8fc7 ",(0,r.jsx)(n.code,{children:"RunOptions"}),"\uff0c",(0,r.jsx)(n.code,{children:"LegacyRunOptions"})," \u6216 ",(0,r.jsx)(n.code,{children:"GenericRunOptions"})," \u65b9\u5f0f\uff0c\u5982\uff1a"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {2,5,8}",children:"// RunOptions \u65b9\u5f0f\r\nServe.Run(RunOptions.DefaultSilence);\r\n\r\n// LegacyRunOptions \u65b9\u5f0f\r\nServe.Run(LegacyRunOptions.DefaultSilence);\r\n\r\n// GenericRunOptions \u65b9\u5f0f\r\nServe.Run(GenericRunOptions.DefaultSilence);\n"})}),"\n",(0,r.jsxs)(n.h2,{id:"2112-net5-\u6a21\u5f0f\u627e\u4e0d\u5230-views-\u89c6\u56fe\u8def\u5f84",children:["2.1.12 ",(0,r.jsx)(n.code,{children:".NET5"})," \u6a21\u5f0f\u627e\u4e0d\u5230 ",(0,r.jsx)(n.code,{children:"Views"})," \u89c6\u56fe\u8def\u5f84"]}),"\n",(0,r.jsxs)(n.p,{children:["\u7531\u4e8e ",(0,r.jsx)(n.code,{children:".NET5"})," \u5fc5\u987b\u5728\u4f7f\u7528 ",(0,r.jsx)(n.code,{children:".UseStartup<>"})," \u914d\u7f6e\u542f\u52a8\u9879\uff0c\u6240\u4ee5 ",(0,r.jsx)(n.code,{children:"Serve.Run()"})," \u6a21\u5f0f\u4f1a\u63d0\u793a\u627e\u4e0d\u5230 ",(0,r.jsx)(n.code,{children:"Views"})," \u89c6\u56fe\u8def\u5f84\uff0c\u8fd9\u65f6\u5019\u53ea\u9700\u8981\u5728\u542f\u52a8\u76ee\u5f55\u521b\u5efa ",(0,r.jsx)(n.code,{children:"Startup.cs"})," \u6587\u4ef6\u5e76\u901a\u8fc7\u6cdb\u578b\u65b9\u5f0f\u6307\u5b9a\u5373\u53ef\uff0c\u5982\uff1a"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:'showLineNumbers title="Startup.cs"',children:"using Microsoft.AspNetCore.Builder;\r\nusing Microsoft.Extensions.DependencyInjection;\r\n\r\nnamespace YourProject.Web.Entity\r\n{\r\n public class Startup\r\n {\r\n public void ConfigureServices(IServiceCollection _)\r\n {\r\n }\r\n\r\n public void Configure(IApplicationBuilder _)\r\n {\r\n }\r\n }\r\n}\n"})}),"\n",(0,r.jsxs)(n.p,{children:["\u5c06 ",(0,r.jsx)(n.code,{children:"Startup"})," \u7c7b\u901a\u8fc7 ",(0,r.jsx)(n.code,{children:"Serve.Run"})," \u6cdb\u578b\u6307\u5b9a\uff1a"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers",children:"Serve.Run<Startup>(LegacyRunOptions.Default);\n"})}),"\n",(0,r.jsx)(n.h2,{id:"2113-\u53cd\u9988\u4e0e\u5efa\u8bae",children:"2.1.13 \u53cd\u9988\u4e0e\u5efa\u8bae"}),"\n",(0,r.jsx)(n.admonition,{title:"\u4e0e\u6211\u4eec\u4ea4\u6d41",type:"note",children:(0,r.jsxs)(n.p,{children:["\u7ed9 Furion \u63d0 ",(0,r.jsx)(n.a,{href:"https://gitee.com/dotnetchina/Furion/issues/new?issue",children:"Issue"}),"\u3002"]})})]})}function x(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(u,{...e})}):u(e)}},510:(e,n,s)=>{s.d(n,{Z:()=>Z});s(7294);const r=(e,n,s)=>e?"string"==typeof e?e:e[n]||s:s;var i=s(5893);const c={display:"block"},l=e=>{let{size:n,color:s,style:l,...d}=e;const o=l?{...c,...l}:c;return(0,i.jsx)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:o,...d,children:(0,i.jsx)("path",{d:"M856.4 292.8c-63.3-63.6-126.6-127.1-190.2-190.3-15.3-15.2-32.7-16.1-48.1-0.8-64.3 63.6-128.1 127.6-191.8 191.9-14 14.2-16.3 31.6-1.7 46 14.8 14.7 31.5 10.6 46.1-2.7 5.1-4.6 9.8-9.7 14.7-14.7 39.2-39.7 78.5-79.5 122.8-124.4 0 170 3 332.2-1.1 494-2.4 96.4-91.2 174.6-187.4 176.6-110.6 2.3-198.6-84.4-199-197.4-0.6-136.3-0.2-272.6-0.1-408.9 0-21.8-7.9-37.4-31.2-39.9-18.9-2-33.2 13.2-33.1 37.5 0 145.8-3.4 291.7 2.4 437.2 6 152.1 160.4 263.5 309.5 230.5C591.8 900 672.8 797.2 673.6 664.6c0.8-144 0.2-288.1 0.2-432.1v-33.3c11.2 10.2 17.6 15.4 23.3 21.3 38.5 38.4 76.7 77 115.3 115.2 14.8 14.6 32.2 19.2 47.8 2.9 13.8-14.8 10.3-31.7-3.8-45.8z",fill:r(s,0,"#333333")})})};l.defaultProps={size:18};const d=l,o={display:"block"},t=e=>{let{size:n,color:s,style:c,...l}=e;const d=c?{...o,...c}:o;return(0,i.jsxs)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:d,...l,children:[(0,i.jsx)("path",{d:"M143.872 768a51.2 51.2 0 0 1-15.36-2.56 51.2 51.2 0 0 1-35.328-51.2V283.136a148.992 148.992 0 0 1 141.824-153.6h450.56a148.992 148.992 0 0 1 141.824 153.6V512a148.992 148.992 0 0 1-141.824 153.6H244.224l-60.928 80.896a51.2 51.2 0 0 1-39.424 21.504zM235.008 180.224a97.792 97.792 0 0 0-90.624 102.4v430.592L218.624 614.4h466.944a97.792 97.792 0 0 0 90.624-102.4V283.136a97.792 97.792 0 0 0-90.624-102.4z",fill:r(s,0,"#333333")}),(0,i.jsx)("path",{d:"M880.128 875.52a51.2 51.2 0 0 1-39.424-20.48l-60.928-80.896h-243.2a25.6 25.6 0 0 1 0-51.2h268.8l76.288 102.4v-295.936a25.6 25.6 0 0 1 25.6-25.6 25.6 25.6 0 0 1 25.6 25.6v293.888a51.2 51.2 0 0 1-51.2 51.2z",fill:r(s,1,"#333333")})]})};t.defaultProps={size:18};const h=t,a={display:"block"},u=e=>{let{size:n,color:s,style:c,...l}=e;const d=c?{...a,...c}:a;return(0,i.jsxs)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:d,...l,children:[(0,i.jsx)("path",{d:"M223.425605 449.2744l161.632237 0 0 253.65714c0 16.954137 13.745049 30.699186 30.699186 30.699186 16.95516 0 30.699186-13.745049 30.699186-30.699186l0-284.356326c0-16.95516-13.744026-30.699186-30.699186-30.699186L291.035446 387.876028l217.23665-248.51605L733.039255 387.580293 607.104031 387.580293c-16.954137 0-30.699186 13.745049-30.699186 30.699186l0 284.652062c0 16.954137 13.745049 30.699186 30.699186 30.699186s30.699186-13.745049 30.699186-30.699186L637.803217 448.978664l164.448376 0c12.140505 0 23.140023-7.154957 28.063149-18.251689 4.922103-11.097756 2.841721-24.053835-5.307889-33.05279L530.62315 72.570829c-5.881964-6.495948-14.273075-10.134825-23.024389-10.091846-8.763594 0.076748-17.076934 3.895727-22.844288 10.494005L200.312188 398.371056c-7.92653 9.067516-9.818623 21.931498-4.839215 32.896224S211.383338 449.2744 223.425605 449.2744z",fill:r(s,0,"#333333")}),(0,i.jsx)("path",{d:"M222.354204 829.113381l581.732178 0c16.954137 0 30.699186-13.745049 30.699186-30.699186s-13.745049-30.699186-30.699186-30.699186L222.354204 767.715009c-16.954137 0-30.699186 13.745049-30.699186 30.699186S205.400067 829.113381 222.354204 829.113381z",fill:r(s,1,"#333333")}),(0,i.jsx)("path",{d:"M804.086381 896.729361 222.354204 896.729361c-16.954137 0-30.699186 13.745049-30.699186 30.699186s13.745049 30.699186 30.699186 30.699186l581.732178 0c16.954137 0 30.699186-13.745049 30.699186-30.699186S821.041542 896.729361 804.086381 896.729361z",fill:r(s,2,"#333333")})]})};u.defaultProps={size:18};const x=u,j={display:"block"},p=e=>{let{size:n,color:s,style:c,...l}=e;const d=c?{...j,...c}:j;return(0,i.jsx)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:d,...l,children:(0,i.jsx)("path",{d:"M380.15463648 874.54223633c0 18.12744166-14.83154297 32.95898463-32.95898463 32.95898463s-32.95898463-14.83154297-32.95898462-32.95898463V228.9152832L172.71078883 370.86962865a33.04467773 33.04467773 0 0 1-46.60400416 0 33.04467773 33.04467773 0 0 1 0-46.6040034l197.55615234-198.14941406A32.76782227 32.76782227 0 0 1 347.0967749 116.52514674c0.03295924 0 0.06591772-0.03295924 0.09887695-0.03295924 1.54907201 0 2.90039088 0.69213867 4.41650366 0.88989258 2.66967773 0.39550781 5.40527318 0.59326172 7.94311548 1.61499049 12.03002904 4.94384766 20.59936549 16.71020508 20.59936549 30.45410156v725.0910642z m320.15698192 23.34155248a32.85351537 32.85351537 0 0 1-23.43383789 9.59106445c-0.03295924 0-0.06591772 0.03295924-0.09887696 0.03295924-1.54907201 0-2.90039088-0.69213867-4.41650365-0.92285182-2.70263697-0.36254857-5.40527318-0.56030248-7.94311549-1.61498972-12.03002904-4.91088842-20.59936549-16.67724584-20.59936473-30.42114309V149.45776367c0-18.12744166 14.83154297-32.95898463 32.95898387-32.95898463s32.95898463 14.83154297 32.95898463 32.95898463v645.60058619l141.52587916-141.92138697c12.81445313-12.82104467 33.81591797-12.82104467 46.63037109 0 12.78808619 12.81445313 12.78808619 33.77636719 0 46.60400416L700.3116184 897.88378881z",fill:r(s,0,"#333333")})})};p.defaultProps={size:18};const g=p,m={display:"block"},v=e=>{let{size:n,color:s,style:c,...l}=e;const d=c?{...m,...c}:m;return(0,i.jsx)("svg",{viewBox:"0 0 1172 1024",width:n+"px",height:n+"px",style:d,...l,children:(0,i.jsx)("path",{d:"M870.0416 250.4704a38.4 38.4 0 0 0-8.96 53.5552c13.056 18.2784 24.4224 37.8368 33.7408 58.112a38.4512 38.4512 0 0 0 50.944 18.8928 38.4512 38.4512 0 0 0 18.8416-50.944 436.0192 436.0192 0 0 0-40.96-70.6048 38.3488 38.3488 0 0 0-53.6064-9.0112zM181.4528 566.016a35.9936 35.9936 0 0 0 25.5488-10.5984L351.7952 410.624a36.096 36.096 0 1 0-51.0976-51.0976L217.6 442.5728C250.0096 278.1184 395.264 153.6 569.1392 153.6c50.7904 0 99.8912 10.3936 145.92 30.9248a38.4 38.4 0 1 0 31.232-70.0928 431.36 431.36 0 0 0-177.152-37.632c-214.6816 0-393.1136 156.416-428.4416 361.216L62.1568 359.4752a36.1984 36.1984 0 0 0-51.0976 51.0976l144.8448 144.7936a36.0448 36.0448 0 0 0 25.5488 10.6496zM978.5344 463.104a36.1984 36.1984 0 0 0-51.0976 0l-144.8448 144.7936a36.096 36.096 0 1 0 51.0976 51.0976l88.6272-88.576C894.3104 740.2496 746.8032 870.4 569.1392 870.4a357.7856 357.7856 0 0 1-325.2736-207.7184 38.4 38.4 0 1 0-69.7344 32.3072 434.3808 434.3808 0 0 0 394.9568 252.2112c215.1936 0 393.984-157.184 428.6464-362.7008l74.496 74.496a35.9936 35.9936 0 0 0 51.0976 0 36.096 36.096 0 0 0 0-51.0976l-144.7936-144.7936z",fill:r(s,0,"#333333")})})};v.defaultProps={size:18};const b=v,f={display:"block"},S=e=>{let{size:n,color:s,style:c,...l}=e;const d=c?{...f,...c}:f;return(0,i.jsxs)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:d,...l,children:[(0,i.jsx)("path",{d:"M302 332a30 30 0 1 1 0-60h420a30 30 0 0 1 0 60H302zM302 542a30 30 0 0 1 0-60h420a30 30 0 0 1 0 60H302zM302 752a30 30 0 0 1 0-60h120a30 30 0 0 1 0 60H302z",fill:r(s,0,"#333333")}),(0,i.jsx)("path",{d:"M789.47 784.1a30 30 0 0 1 39.36 45.3l-144.24 125.25a30 30 0 0 1-19.68 7.35H214.85C163.4 962 122 919.46 122 867.38V156.62C122 104.54 163.4 62 214.85 62h594.3C860.6 62 902 104.54 902 156.62v529.05a30 30 0 1 1-60 0V156.62C842 137.3 827.09 122 809.15 122H214.85C196.91 122 182 137.3 182 156.62v710.76C182 886.7 196.91 902 214.85 902h438.84l135.78-117.9z",fill:r(s,1,"#333333")}),(0,i.jsx)("path",{d:"M692 931.19a30 30 0 1 1-60 0v-174.6C632 704.57 673.4 662 724.85 662h147.78a30 30 0 0 1 0 60h-147.78c-17.94 0-32.85 15.3-32.85 34.62v174.6z",fill:r(s,2,"#333333")})]})};S.defaultProps={size:18};const N=S,R={display:"block"},w=e=>{let{size:n,color:s,style:c,...l}=e;const d=c?{...R,...c}:R;return(0,i.jsxs)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:d,...l,children:[(0,i.jsx)("path",{d:"M512 883.2A371.2 371.2 0 1 0 140.8 512 371.2 371.2 0 0 0 512 883.2z m0 64a435.2 435.2 0 1 1 435.2-435.2 435.2 435.2 0 0 1-435.2 435.2z",fill:r(s,0,"#333333")}),(0,i.jsx)("path",{d:"M557.056 512l122.368 122.368a31.744 31.744 0 1 1-45.056 45.056L512 557.056l-122.368 122.368a31.744 31.744 0 1 1-45.056-45.056L466.944 512 344.576 389.632a31.744 31.744 0 1 1 45.056-45.056L512 466.944l122.368-122.368a31.744 31.744 0 1 1 45.056 45.056z",fill:r(s,1,"#333333")})]})};w.defaultProps={size:18};const C=w,y={display:"block"},L=e=>{let{size:n,color:s,style:c,...l}=e;const d=c?{...y,...c}:y;return(0,i.jsxs)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:d,...l,children:[(0,i.jsx)("path",{d:"M940 512H792V412c76.8 0 139-62.2 139-139 0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 34.8-28.2 63-63 63H232c-34.8 0-63-28.2-63-63 0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 76.8 62.2 139 139 139v100H84c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h148v96c0 6.5 0.2 13 0.7 19.3C164.1 728.6 116 796.7 116 876c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-44.2 23.9-82.9 59.6-103.7 6 17.2 13.6 33.6 22.7 49 24.3 41.5 59 76.2 100.5 100.5S460.5 960 512 960s99.8-13.9 141.3-38.2c41.5-24.3 76.2-59 100.5-100.5 9.1-15.5 16.7-31.9 22.7-49C812.1 793.1 836 831.8 836 876c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-79.3-48.1-147.4-116.7-176.7 0.4-6.4 0.7-12.8 0.7-19.3v-96h148c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM716 680c0 36.8-9.7 72-27.8 102.9-17.7 30.3-43 55.6-73.3 73.3-20.1 11.8-42 20-64.9 24.3V484c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v396.5c-22.9-4.3-44.8-12.5-64.9-24.3-30.3-17.7-55.6-43-73.3-73.3C317.7 752 308 716.8 308 680V412h408v268z",fill:r(s,0,"#333333")}),(0,i.jsx)("path",{d:"M304 280h56c4.4 0 8-3.6 8-8 0-28.3 5.9-53.2 17.1-73.5 10.6-19.4 26-34.8 45.4-45.4C450.9 142 475.7 136 504 136h16c28.3 0 53.2 5.9 73.5 17.1 19.4 10.6 34.8 26 45.4 45.4C650 218.9 656 243.7 656 272c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-40-8.8-76.7-25.9-108.1-17.2-31.5-42.5-56.8-74-74C596.7 72.8 560 64 520 64h-16c-40 0-76.7 8.8-108.1 25.9-31.5 17.2-56.8 42.5-74 74C304.8 195.3 296 232 296 272c0 4.4 3.6 8 8 8z",fill:r(s,1,"#333333")})]})};L.defaultProps={size:18};const W=L,F={display:"block"},A=e=>{let{size:n,color:s,style:c,...l}=e;const d=c?{...F,...c}:F;return(0,i.jsxs)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:d,...l,children:[(0,i.jsx)("path",{d:"M512 71.68c-242.688 0-440.32 197.632-440.32 440.32s197.632 440.32 440.32 440.32 440.32-197.632 440.32-440.32-197.632-440.32-440.32-440.32z m0 819.2c-208.896 0-378.88-169.984-378.88-378.88s169.984-378.88 378.88-378.88 378.88 169.984 378.88 378.88-169.984 378.88-378.88 378.88z",fill:r(s,0,"#333333")}),(0,i.jsx)("path",{d:"M542.72 261.12H481.28v220.16H261.12v61.44h220.16v220.16h61.44v-220.16h220.16V481.28h-220.16z",fill:r(s,1,"#333333")})]})};A.defaultProps={size:18};const z=A,H={display:"block"},P=e=>{let{size:n,color:s,style:c,...l}=e;const d=c?{...H,...c}:H;return(0,i.jsx)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:d,...l,children:(0,i.jsx)("path",{d:"M384 896h-64v-70.4c0-15.2-10.4-28-24.8-31.2C159.2 768 64 644.8 64 496v-32h64v32c0 118.4 73.6 215.2 179.2 236 44.8 8.8 76.8 48 76.8 94.4v69.6zM704 896h-64v-70.4c0-45.6 32-85.6 76.8-94.4C822.4 711.2 896 614.4 896 496v-32h64v32c0 148.8-95.2 272-231.2 298.4-14.4 3.2-24.8 16-24.8 31.2v70.4zM512.8 640l-41.6-37.6c-147.2-133.6-244-208-244-316.8 0-88 68.8-156.8 156.8-156.8 49.6 0 97.6 23.2 128.8 60C544 152 592 128.8 641.6 128.8c88 0 156.8 68.8 156.8 156.8 0 108-96.8 183.2-244 316.8L512.8 640z",fill:r(s,0,"#333333")})})};P.defaultProps={size:18};const M=P,O={display:"block"},I=e=>{let{size:n,color:s,style:c,...l}=e;const d=c?{...O,...c}:O;return(0,i.jsx)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:d,...l,children:(0,i.jsx)("path",{d:"M942.4615936 284.62787926c-14.30911886-14.12709945-37.31996786-14.05468217-51.48229632 0.21920654L517.97142983 661.27810333 139.75544149 286.45003606c-14.30911886-14.16232846-37.31996786-14.05468217-51.51948344 0.21920654-14.16232846 14.30911886-14.05468217 37.35519687 0.21920654 51.51948345l401.99014627 398.34974663c0.61847666 0.61847666 1.41897273 0.76526706 2.03940637 1.34655658 0.14483342 0.14483342 0.18201941 0.32685283 0.32685283 0.47364324 7.09877874 7.02636259 16.38375538 10.55911595 25.63154489 10.55911595 9.35739278 0 18.75001458-3.60516949 25.85075143-10.77636551l398.34974663-401.99014628C956.84312974 321.8382427 956.73548345 298.7921647 942.4615936 284.62787926z",fill:r(s,0,"#333333")})})};I.defaultProps={size:18};const E=I,B={display:"block"},D=e=>{let{size:n,color:s,style:c,...l}=e;const d=c?{...B,...c}:B;return(0,i.jsx)("svg",{viewBox:"0 0 1024 1024",width:n+"px",height:n+"px",style:d,...l,children:(0,i.jsx)("path",{d:"M81.5384064 739.37212074c14.30911886 14.12709945 37.31996786 14.05468217 51.48229632-0.21920654L506.02857017 362.72189667 884.24455851 737.54996394c14.30911886 14.16232846 37.31996786 14.05468217 51.51948344-0.21920654 14.16232846-14.30911886 14.05468217-37.35519687-0.21920654-51.51948345l-401.99014627-398.34974663c-0.61847666-0.61847666-1.41897273-0.76526706-2.03940637-1.34655658-0.14483342-0.14483342-0.18201941-0.32685283-0.32685282-0.47364324-7.09877874-7.02636259-16.38375538-10.55911595-25.6315449-10.55911595-9.35739278 0-18.75001458 3.60516949-25.85075143 10.77636551l-398.34974663 401.99014628C67.15687026 702.1617573 67.26451655 725.2078353 81.5384064 739.37212074z",fill:r(s,0,"#333333")})})};D.defaultProps={size:18};const k=D,T=e=>{let{name:n,...s}=e;switch(n){case"youhua":return(0,i.jsx)(d,{...s});case"dayi":return(0,i.jsx)(h,{...s});case"shengji":return(0,i.jsx)(x,{...s});case"tiaozheng":return(0,i.jsx)(g,{...s});case"gengxin":return(0,i.jsx)(b,{...s});case"wendang":return(0,i.jsx)(N,{...s});case"shanchu":return(0,i.jsx)(C,{...s});case"bug":return(0,i.jsx)(W,{...s});case"xinzeng":return(0,i.jsx)(z,{...s});case"fuwu":return(0,i.jsx)(M,{...s});case"down":return(0,i.jsx)(E,{...s});case"up":return(0,i.jsx)(k,{...s})}return null},U={label:"label_p8vM",icon:"icon_knQK"};function Z(e){const{children:n}=e,s={"\u65b0\u589e":{icon:"xinzeng",bgColor:"#39b54a"},"\u4fee\u590d":{icon:"bug",bgColor:"#9c26b0"},"\u6587\u6863":{icon:"wendang",bgColor:"rgb(79, 147, 255)"},"\u66f4\u65b0":{icon:"gengxin",bgColor:"#0081ff"},"\u8c03\u6574":{icon:"tiaozheng",bgColor:"#333"},"\u5347\u7ea7":{icon:"shengji",bgColor:"#e03997"},"\u79fb\u9664":{icon:"shanchu",bgColor:"#666"},"\u7b54\u7591":{icon:"dayi",bgColor:"#bbb"},"\u4f18\u5316":{icon:"youhua",bgColor:"#38e550"}};return(0,i.jsxs)("label",{className:U.label,title:n,style:{backgroundColor:s[n].bgColor},children:[(0,i.jsx)(T,{name:s[n].icon,color:"white",size:14,className:U.icon})," ",n]})}},1151:(e,n,s)=>{s.d(n,{Z:()=>d,a:()=>l});var r=s(7294);const i={},c=r.createContext(i);function l(e){const n=r.useContext(c);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),r.createElement(c.Provider,{value:n},e.children)}}}]);