mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 13:20:19 +08:00
feat: refactor code to use responseOK everywhere (#2111)
* refactor: use responseOK return frontend format json data * revert handle error * revert handle error
This commit is contained in:
@ -68,8 +68,9 @@ class PlanEditPage extends React.Component {
|
||||
Setting.showMessage("error", res.msg);
|
||||
return;
|
||||
}
|
||||
|
||||
this.setState({
|
||||
roles: res,
|
||||
roles: res.data,
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -81,8 +82,9 @@ class PlanEditPage extends React.Component {
|
||||
Setting.showMessage("error", res.msg);
|
||||
return;
|
||||
}
|
||||
|
||||
this.setState({
|
||||
users: res,
|
||||
users: res.data,
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -91,7 +93,7 @@ class PlanEditPage extends React.Component {
|
||||
OrganizationBackend.getOrganizations("admin")
|
||||
.then((res) => {
|
||||
this.setState({
|
||||
organizations: (res.msg === undefined) ? res : [],
|
||||
organizations: res.data || [],
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user