mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 21:30:24 +08:00
feat: response with status in casbin_adapter.go
(#1384)
* fix: response standardized information with status in `casbin_adapter.go` * fix: remove redundant statements
This commit is contained in:
@ -48,12 +48,14 @@ class AdapterEditPage extends React.Component {
|
||||
|
||||
getAdapter() {
|
||||
AdapterBackend.getAdapter(this.state.owner, this.state.adapterName)
|
||||
.then((adapter) => {
|
||||
this.setState({
|
||||
adapter: adapter,
|
||||
});
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
this.setState({
|
||||
adapter: res.data,
|
||||
});
|
||||
|
||||
this.getModels(adapter.owner);
|
||||
this.getModels(this.adapter.owner);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,7 @@ class PolicyTable extends React.Component {
|
||||
AdapterBackend.syncPolicies(this.props.owner, this.props.name)
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
this.setState({policyLists: res});
|
||||
this.setState({policyLists: res.data});
|
||||
} else {
|
||||
Setting.showMessage("error", `${i18next.t("adapter:Failed to sync policies")}: ${res.msg}`);
|
||||
}
|
||||
|
Reference in New Issue
Block a user