我已经在 api 服务中发布了 UI,但我想从“/”开始 url。但它以http://localhost:8090/UI/的形式出现。问题是在路由配置中我已经设置了路由为:-
ReactDOM.render((
<Router history={browserHistory}>
<Route path="/" component={Login}/>
<Route path="main" component={main}>
<IndexRoute component={Home} />
<Route path = "/Accession" component = {Home} />
<Route path="/contact" component={Contact}/>
</Route>
</Router>
), document.getElementById('App'));
错误:/UI/ 未在路由中定义。要解决此问题,我必须将路由更改为Route path="/UI/" 。如何将“/”设置为初始路径?