Fix getAccount() bug
This commit is contained in:
parent
737dd4df4e
commit
081b88a2be
|
@ -126,18 +126,14 @@ class App extends Component {
|
||||||
getAccount() {
|
getAccount() {
|
||||||
AccountBackend.getAccount()
|
AccountBackend.getAccount()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.status === "ok") {
|
const account = res.data;
|
||||||
const account = res.data;
|
if (account !== null) {
|
||||||
if (account !== null) {
|
this.setLanguage(account);
|
||||||
this.setLanguage(account);
|
|
||||||
}
|
|
||||||
this.setState({
|
|
||||||
account: account,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
Setting.showMessage("error", `Failed to get account: ${res.msg}`);
|
|
||||||
Setting.goToLink("/signin");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
account: account,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ export let CasdoorSdk;
|
||||||
|
|
||||||
export function initServerUrl() {
|
export function initServerUrl() {
|
||||||
const hostname = window.location.hostname;
|
const hostname = window.location.hostname;
|
||||||
if (hostname === "localhost" || hostname === "127.0.0.1") {
|
if (hostname === "localhost") {
|
||||||
ServerUrl = `http://${hostname}:14000`;
|
ServerUrl = `http://${hostname}:14000`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,7 +145,7 @@ class StoreListPage extends React.Component {
|
||||||
title: i18next.t("general:Action"),
|
title: i18next.t("general:Action"),
|
||||||
dataIndex: "action",
|
dataIndex: "action",
|
||||||
key: "action",
|
key: "action",
|
||||||
width: "300px",
|
width: "400px",
|
||||||
render: (text, record, index) => {
|
render: (text, record, index) => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|
Loading…
Reference in New Issue