@@ -166,24 +166,20 @@ export default {
166166 try {
167167 this .loading = true
168168 res = await Admin .deleteOneUser (val .row .id )
169- } catch (e) {
170- this .loading = false
171- console .log (e)
172- }
173- if (res .code < window .MAX_SUCCESS_CODE ) {
174169 this .loading = false
175- if (this .total_nums % this .pageCount === 1 && this .currentPage !== 1 ) {
176- // 判断删除的是不是每一页的最后一条数据
177- this .currentPage --
170+ if (res .code < window .MAX_SUCCESS_CODE ) {
171+ if (this .total_nums % this .pageCount === 1 && this .currentPage !== 1 ) {
172+ // 判断删除的是不是每一页的最后一条数据
173+ this .currentPage --
174+ }
175+ await this .getAdminUsers ()
176+ this .$message ({
177+ type: ' success' ,
178+ message: ` ${ res .message } ` ,
179+ })
178180 }
179- await this .getAdminUsers ()
180- this .$message ({
181- type: ' success' ,
182- message: ` ${ res .message } ` ,
183- })
184- } else {
181+ } catch (e) {
185182 this .loading = false
186- this .$message .error (` ${ res .message } ` )
187183 }
188184 })
189185 },
@@ -259,10 +255,7 @@ export default {
259255 async created () {
260256 await this .getAdminUsers ()
261257 this .getAllGroups ()
262- this .tableColumn = [
263- { prop: ' username' , label: ' 名称' },
264- { prop: ' groupNames' , label: ' 所属分组' },
265- ] // 设置表头信息
258+ this .tableColumn = [{ prop: ' username' , label: ' 名称' }, { prop: ' groupNames' , label: ' 所属分组' }] // 设置表头信息
266259 this .operate = [
267260 { name: ' 编辑' , func: ' handleEdit' , type: ' primary' },
268261 { name: ' 删除' , func: ' handleDelete' , type: ' danger' },
0 commit comments