Browse Source

Fix getAccount() bug

HEAD
Yang Luo 2 years ago
parent
commit
081b88a2be
3 changed files with 9 additions and 13 deletions
  1. +7
    -11
      web/src/App.js
  2. +1
    -1
      web/src/Setting.js
  3. +1
    -1
      web/src/StoreListPage.js

+ 7
- 11
web/src/App.js View File

@@ -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,
});
});
}



+ 1
- 1
web/src/Setting.js View File

@@ -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`;
}
}


+ 1
- 1
web/src/StoreListPage.js View File

@@ -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 (
<div>


Loading…
Cancel
Save