@@ -166,24 +166,20 @@ export default {
166
166
try {
167
167
this .loading = true
168
168
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 ) {
174
169
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
+ })
178
180
}
179
- await this .getAdminUsers ()
180
- this .$message ({
181
- type: ' success' ,
182
- message: ` ${ res .message } ` ,
183
- })
184
- } else {
181
+ } catch (e) {
185
182
this .loading = false
186
- this .$message .error (` ${ res .message } ` )
187
183
}
188
184
})
189
185
},
@@ -259,10 +255,7 @@ export default {
259
255
async created () {
260
256
await this .getAdminUsers ()
261
257
this .getAllGroups ()
262
- this .tableColumn = [
263
- { prop: ' username' , label: ' 名称' },
264
- { prop: ' groupNames' , label: ' 所属分组' },
265
- ] // 设置表头信息
258
+ this .tableColumn = [{ prop: ' username' , label: ' 名称' }, { prop: ' groupNames' , label: ' 所属分组' }] // 设置表头信息
266
259
this .operate = [
267
260
{ name: ' 编辑' , func: ' handleEdit' , type: ' primary' },
268
261
{ name: ' 删除' , func: ' handleDelete' , type: ' danger' },
0 commit comments