目前:
localhost:80/index
localhost:80/login
这类页面都没有问题,刷新当前页可以显示对应页面;
web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Handle History Mode and custom 404/500" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
但是当目录有2层的时候,就会出现页面空白
例如:
localhost:80/index 可以通过菜单跳转到 localhost:80/list/page,
页面能正常显示,但是刷新当前页面,就空白了
控制台报错:Uncaught SyntaxError: Unexpected token <
已解决.
webpack.prod.config.js
publicPath:'http://.....'
写服务器地址就好了