Skip to content

Commit

Permalink
fix: swagger bug in dev mode (#291)
Browse files Browse the repository at this point in the history
Signed-off-by: sh1luo <690898835@qq.com>
  • Loading branch information
sh1luo committed Sep 12, 2021
1 parent c70c62f commit 52d9017
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion web/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ class App extends Component {

res.push(
<Menu.Item key="/swagger">
<a target="_blank" rel="noreferrer" href={"/swagger"}>
<a target="_blank" rel="noreferrer" href={Setting.isLocalhost ? `${Setting.ServerUrl}/swagger` : "/swagger"}>
{i18next.t("general:Swagger")}
</a>
</Menu.Item>
Expand Down
2 changes: 1 addition & 1 deletion web/src/Setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function initServerUrl() {
}
}

function isLocalhost() {
export function isLocalhost() {
const hostname = window.location.hostname;
return hostname === "localhost";
}
Expand Down

0 comments on commit 52d9017

Please sign in to comment.