React Router正在发送带有未定义参数的不必要请求

时间:2020-07-21 16:20:46

标签: react-router

我遇到了一个问题。当我使用React-Router时,当我链接到其他页面时,它将发送更多无用的请求,例如“ http:// localhost:8080 / undefined”,我该如何解决? Router code picture

<Route exact path={"/"}
     render={({ location }) => {
        return (getItemlocalStorage("Auth") !== null) ? (
           urlMapping["/"]
           ) : (
           <Redirect
             to={{
               pathname: "/Login",
           }}
        />
      );
  }
  }>
</Route>

Request in Chrome Devtool picture

0 个答案:

没有答案