refactor(src/views/user/): 优化用户操作

duizhaopin_ui
duan 3 years ago
parent 104eb78179
commit 3ea33d2ae9

@ -34,6 +34,15 @@ export function user_power(data) {
}) })
} }
// /api/power/user_power
export function get_module_list(data) {
return request({
url: '/api/power/get_module_list',
method: 'post',
data
})
}
// /api/user/update // /api/user/update
export function update(data) { export function update(data) {
return request({ return request({
@ -52,6 +61,15 @@ export function del(data) {
}) })
} }
// /api/power/get_list
export function get_role_list(data) {
return request({
url: '/api/power/get_list',
method: 'post',
data
})
}
// export function getInfo(token) { // export function getInfo(token) {
// return request({ // return request({
// url: '/vue-admin-template/user/info', // url: '/vue-admin-template/user/info',

@ -234,11 +234,13 @@ export default {
add(stringify(data)).then(res => { add(stringify(data)).then(res => {
this.$message.success(res.msg) this.$message.success(res.msg)
this.dialogVisible = false this.dialogVisible = false
this.getList()
}) })
} else { } else {
update(stringify(data)).then(res => { update(stringify(data)).then(res => {
this.$message.success(res.msg) this.$message.success(res.msg)
this.dialogVisible = false this.dialogVisible = false
this.getList()
}) })
} }
}, },
@ -246,7 +248,7 @@ export default {
this.userFormData = {} this.userFormData = {}
}, },
handleUserFormCancel() { handleUserFormCancel() {
this.dialogVisible = true this.dialogVisible = false
this.userFormData = {} this.userFormData = {}
}, },
handleAddUser() { handleAddUser() {
@ -276,7 +278,7 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => }).then(() =>
del(stringify({ 'user_id': this.multipleSelection[0].user })).then( del(stringify({ 'user_id': this.multipleSelection[0].user_id })).then(
res => { res => {
this.$message.success({ this.$message.success({
type: 'success', type: 'success',

Loading…
Cancel
Save