1.IIS添加网站,应用程序池4.0 集成
2.安装两个模块
3.网站-IIS里找到ARR
4.安装ServerSideIncludeModule模块
勾选后确认安装
5.把以下代码替换到webconfig里
XML
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="vue" enabled="true" stopProcessing="true">
<match url="api/(.*)" />
<action type="Rewrite" url="http://你的接口地址/api/{R:1}" logRewrittenUrl="true" />
</rule>
</rules>
</rewrite>
<handlers>
<add name="vue" path="*.html" verb="*" modules="ServerSideIncludeModule" resourceType="File" />
</handlers>
</system.webServer>
</configuration>
6.重启网站