用的是react-router4,每一次手动输入url进行跳转都会自动添加一个#
比如 我输入 localhost:8000/index => localhost:8000/index#/ 变成这样了
路由代码是
function RouterConfig({ history }) {
return(
<Router history={history}>
<Switch>
<Route exact path="" component={lsPage}/>
<Route exact path="/index" component={layout} />
</Switch>
</Router>
)
}
export default RouterConfig;
您是不是使用的hashHistory路由。
使用hashHistory,浏览器的url就是这样的:localhost:8000/index#/
而使用browserHistory,浏览器的url是这样的:localhost:8000/index
希望我的回答能帮助到您^_^