Skip to content

Commit

Permalink
feat(manage): update delete user Unregistered
Browse files Browse the repository at this point in the history
  • Loading branch information
nicejade committed Mar 27, 2018
1 parent e3e557a commit e3d25d5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/helper/apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ export default {
updateAvatar (data) {
return $ajax.post(requestUrl('updateAvatar'), data)
},

removeUserById (data) {
return $ajax.post(requestUrl('removeUserById'), data)
},
// ---------------------Config-----------------------
getSysConf (data) {
return $ajax.get(requestUrl('getSysConf'), data)
Expand Down
18 changes: 13 additions & 5 deletions src/views/manage/Users.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
</el-table-column>
<el-table-column :label="$t('operation')" width="160">
<template scope="scope">
<el-button size="small"
@click="handleEdit(scope.row)">{{ $t('edit') }}
</el-button>
<el-button size="small" type="danger"
@click="handleDelete(scope.row)">{{ $t('delete') }}
</el-button>
Expand Down Expand Up @@ -129,7 +126,6 @@ export default{
},
handleCurrentChange (val) {
console.log(val)
this.tableControl.pageCount = val
this.initFetch()
},
Expand All @@ -144,7 +140,19 @@ export default{
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// body
params.operatorId = this.userInfo && this.userInfo._id
this.isLoading = true
this.$apis.removeUserById(params).then(result => {
this.$message({
type: 'success',
message: '删除成功!'
})
}).catch((error) => {
this.$message.error(`${error}`)
}).finally(() => {
this.isLoading = false
})
}).catch(() => {
this.$message({
type: 'info',
Expand Down

0 comments on commit e3d25d5

Please sign in to comment.