Fix getAccount() response.

This commit is contained in:
Yang Luo 2021-03-28 10:48:56 +08:00
parent 0127f8fb63
commit 2029a28d7b
2 changed files with 2 additions and 7 deletions

View File

@ -132,7 +132,7 @@ func (c *ApiController) GetAccount() {
username := c.GetSessionUser()
userObj := object.GetUser(username)
resp = Response{Status: "ok", Msg: "", Data: util.StructToJson(userObj)}
resp = Response{Status: "ok", Msg: "", Data: userObj}
c.Data["json"] = resp
c.ServeJSON()

View File

@ -105,16 +105,11 @@ class App extends Component {
}
}
onLoggedIn() {
this.getAccount();
}
getAccount() {
AuthBackend.getAccount()
.then((res) => {
const account = Setting.parseJson(res.data);
this.setState({
account: account,
account: res.data,
});
});
}