This commit is contained in:
xuyucheng 2022-03-11 16:31:51 +08:00
parent 0fc8a91fc8
commit 78167af2cd
1 changed files with 16 additions and 2 deletions

View File

@ -14,7 +14,8 @@ class UserSet extends Component {
this.state = {
visible: false,
data: [],
columns: []
columns: [],
loading:false
}
}
@ -75,10 +76,12 @@ class UserSet extends Component {
if (e === "停 用") {
api.get("/admin/user/disable_user", { UID: value.UID }).then(res => {
message.success(res.info)
this.onSearch()
})
} else if (e === "删 除") {
api.get("/admin/user/delete_user", { UID: value.UID }).then(res => {
message.success(res.info)
this.onSearch()
})
}else {
return false
@ -87,6 +90,9 @@ class UserSet extends Component {
onAdd = () => {
this.setState({
loading:true
})
const form = this.AddForm.current
const data = {
email: form.getFieldsValue().email,
@ -95,7 +101,14 @@ class UserSet extends Component {
role: form.getFieldsValue().role,
}
api.post("/admin/user/create_user", data).then(res => {
message.success(res.info)
this.setState({
loading:false
},()=>{
message.success(res.info)
this.onCancel()
this.onSearch()
})
})
}
@ -119,6 +132,7 @@ class UserSet extends Component {
cancelText="取 消"
onCancel={this.onCancel}
onOk={this.onAdd}
confirmLoading={this.state.loading}
>
<Form
ref={this.AddForm}