From 081b88a2be8accce409dba4968da6e0abc223de2 Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Mon, 14 Aug 2023 02:33:11 +0800 Subject: [PATCH] Fix getAccount() bug --- web/src/App.js | 18 +++++++----------- web/src/Setting.js | 2 +- web/src/StoreListPage.js | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/web/src/App.js b/web/src/App.js index 824f103..38d164e 100644 --- a/web/src/App.js +++ b/web/src/App.js @@ -126,18 +126,14 @@ class App extends Component { getAccount() { AccountBackend.getAccount() .then((res) => { - if (res.status === "ok") { - const account = res.data; - if (account !== null) { - this.setLanguage(account); - } - this.setState({ - account: account, - }); - } else { - Setting.showMessage("error", `Failed to get account: ${res.msg}`); - Setting.goToLink("/signin"); + const account = res.data; + if (account !== null) { + this.setLanguage(account); } + + this.setState({ + account: account, + }); }); } diff --git a/web/src/Setting.js b/web/src/Setting.js index 8aef377..05dc800 100644 --- a/web/src/Setting.js +++ b/web/src/Setting.js @@ -27,7 +27,7 @@ export let CasdoorSdk; export function initServerUrl() { const hostname = window.location.hostname; - if (hostname === "localhost" || hostname === "127.0.0.1") { + if (hostname === "localhost") { ServerUrl = `http://${hostname}:14000`; } } diff --git a/web/src/StoreListPage.js b/web/src/StoreListPage.js index 7bac7c5..2bdcb47 100644 --- a/web/src/StoreListPage.js +++ b/web/src/StoreListPage.js @@ -145,7 +145,7 @@ class StoreListPage extends React.Component { title: i18next.t("general:Action"), dataIndex: "action", key: "action", - width: "300px", + width: "400px", render: (text, record, index) => { return (