Explorar o código

删除不必要的代码

RuoYi %!s(int64=5) %!d(string=hai) anos
pai
achega
7bd762267b

+ 7 - 11
ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm

@@ -420,19 +420,15 @@ export default {
420 420
 #end
421 421
           if (this.form.${pkColumn.javaField} != null) {
422 422
             update${BusinessName}(this.form).then(response => {
423
-              if (response.code === 200) {
424
-                this.msgSuccess("修改成功");
425
-                this.open = false;
426
-                this.getList();
427
-              }
423
+              this.msgSuccess("修改成功");
424
+              this.open = false;
425
+              this.getList();
428 426
             });
429 427
           } else {
430 428
             add${BusinessName}(this.form).then(response => {
431
-              if (response.code === 200) {
432
-                this.msgSuccess("新增成功");
433
-                this.open = false;
434
-                this.getList();
435
-              }
429
+              this.msgSuccess("新增成功");
430
+              this.open = false;
431
+              this.getList();
436 432
             });
437 433
           }
438 434
         }
@@ -449,7 +445,7 @@ export default {
449 445
         }).then(() => {
450 446
           this.getList();
451 447
           this.msgSuccess("删除成功");
452
-        }).catch(function() {});
448
+        })
453 449
     }
454 450
   }
455 451
 };

+ 7 - 11
ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm

@@ -436,19 +436,15 @@ export default {
436 436
 #end
437 437
           if (this.form.${pkColumn.javaField} != null) {
438 438
             update${BusinessName}(this.form).then(response => {
439
-              if (response.code === 200) {
440
-                this.msgSuccess("修改成功");
441
-                this.open = false;
442
-                this.getList();
443
-              }
439
+              this.msgSuccess("修改成功");
440
+              this.open = false;
441
+              this.getList();
444 442
             });
445 443
           } else {
446 444
             add${BusinessName}(this.form).then(response => {
447
-              if (response.code === 200) {
448
-                this.msgSuccess("新增成功");
449
-                this.open = false;
450
-                this.getList();
451
-              }
445
+              this.msgSuccess("新增成功");
446
+              this.open = false;
447
+              this.getList();
452 448
             });
453 449
           }
454 450
         }
@@ -466,7 +462,7 @@ export default {
466 462
         }).then(() => {
467 463
           this.getList();
468 464
           this.msgSuccess("删除成功");
469
-        }).catch(function() {});
465
+        })
470 466
     },
471 467
     /** 导出按钮操作 */
472 468
     handleExport() {

+ 8 - 12
ruoyi-ui/src/views/monitor/job/index.vue

@@ -402,7 +402,7 @@ export default {
402 402
           return runJob(row.jobId, row.jobGroup);
403 403
         }).then(() => {
404 404
           this.msgSuccess("执行成功");
405
-        }).catch(function() {});
405
+        })
406 406
     },
407 407
     /** 任务详细信息 */
408 408
     handleView(row) {
@@ -437,19 +437,15 @@ export default {
437 437
         if (valid) {
438 438
           if (this.form.jobId != undefined) {
439 439
             updateJob(this.form).then(response => {
440
-              if (response.code === 200) {
441
-                this.msgSuccess("修改成功");
442
-                this.open = false;
443
-                this.getList();
444
-              }
440
+              this.msgSuccess("修改成功");
441
+              this.open = false;
442
+              this.getList();
445 443
             });
446 444
           } else {
447 445
             addJob(this.form).then(response => {
448
-              if (response.code === 200) {
449
-                this.msgSuccess("新增成功");
450
-                this.open = false;
451
-                this.getList();
452
-              }
446
+              this.msgSuccess("新增成功");
447
+              this.open = false;
448
+              this.getList();
453 449
             });
454 450
           }
455 451
         }
@@ -467,7 +463,7 @@ export default {
467 463
         }).then(() => {
468 464
           this.getList();
469 465
           this.msgSuccess("删除成功");
470
-        }).catch(function() {});
466
+        })
471 467
     },
472 468
     /** 导出按钮操作 */
473 469
     handleExport() {

+ 2 - 2
ruoyi-ui/src/views/monitor/job/log.vue

@@ -263,7 +263,7 @@ export default {
263 263
         }).then(() => {
264 264
           this.getList();
265 265
           this.msgSuccess("删除成功");
266
-        }).catch(function() {});
266
+        })
267 267
     },
268 268
     /** 清空按钮操作 */
269 269
     handleClean() {
@@ -276,7 +276,7 @@ export default {
276 276
         }).then(() => {
277 277
           this.getList();
278 278
           this.msgSuccess("清空成功");
279
-        }).catch(function() {});
279
+        })
280 280
     },
281 281
     /** 导出按钮操作 */
282 282
     handleExport() {

+ 1 - 1
ruoyi-ui/src/views/monitor/online/index.vue

@@ -116,7 +116,7 @@ export default {
116 116
         }).then(() => {
117 117
           this.getList();
118 118
           this.msgSuccess("强退成功");
119
-        }).catch(function() {});
119
+        })
120 120
     }
121 121
   }
122 122
 };

+ 8 - 16
ruoyi-ui/src/views/system/config/index.vue

@@ -304,19 +304,15 @@ export default {
304 304
         if (valid) {
305 305
           if (this.form.configId != undefined) {
306 306
             updateConfig(this.form).then(response => {
307
-              if (response.code === 200) {
308
-                this.msgSuccess("修改成功");
309
-                this.open = false;
310
-                this.getList();
311
-              }
307
+              this.msgSuccess("修改成功");
308
+              this.open = false;
309
+              this.getList();
312 310
             });
313 311
           } else {
314 312
             addConfig(this.form).then(response => {
315
-              if (response.code === 200) {
316
-                this.msgSuccess("新增成功");
317
-                this.open = false;
318
-                this.getList();
319
-              }
313
+              this.msgSuccess("新增成功");
314
+              this.open = false;
315
+              this.getList();
320 316
             });
321 317
           }
322 318
         }
@@ -334,7 +330,7 @@ export default {
334 330
         }).then(() => {
335 331
           this.getList();
336 332
           this.msgSuccess("删除成功");
337
-        }).catch(function() {});
333
+        })
338 334
     },
339 335
     /** 导出按钮操作 */
340 336
     handleExport() {
@@ -345,11 +341,7 @@ export default {
345 341
     /** 清理缓存按钮操作 */
346 342
     handleClearCache() {
347 343
       clearCache().then(response => {
348
-        if (response.code === 200) {
349
-          this.msgSuccess("清理成功");
350
-        } else {
351
-          this.msgError(response.msg);
352
-        }
344
+        this.msgSuccess("清理成功");
353 345
       });
354 346
     }
355 347
   }

+ 7 - 11
ruoyi-ui/src/views/system/dept/index.vue

@@ -284,19 +284,15 @@ export default {
284 284
         if (valid) {
285 285
           if (this.form.deptId != undefined) {
286 286
             updateDept(this.form).then(response => {
287
-              if (response.code === 200) {
288
-                this.msgSuccess("修改成功");
289
-                this.open = false;
290
-                this.getList();
291
-              }
287
+              this.msgSuccess("修改成功");
288
+              this.open = false;
289
+              this.getList();
292 290
             });
293 291
           } else {
294 292
             addDept(this.form).then(response => {
295
-              if (response.code === 200) {
296
-                this.msgSuccess("新增成功");
297
-                this.open = false;
298
-                this.getList();
299
-              }
293
+              this.msgSuccess("新增成功");
294
+              this.open = false;
295
+              this.getList();
300 296
             });
301 297
           }
302 298
         }
@@ -313,7 +309,7 @@ export default {
313 309
         }).then(() => {
314 310
           this.getList();
315 311
           this.msgSuccess("删除成功");
316
-        }).catch(function() {});
312
+        })
317 313
     }
318 314
   }
319 315
 };

+ 7 - 11
ruoyi-ui/src/views/system/dict/data.vue

@@ -304,19 +304,15 @@ export default {
304 304
         if (valid) {
305 305
           if (this.form.dictCode != undefined) {
306 306
             updateData(this.form).then(response => {
307
-              if (response.code === 200) {
308
-                this.msgSuccess("修改成功");
309
-                this.open = false;
310
-                this.getList();
311
-              }
307
+              this.msgSuccess("修改成功");
308
+              this.open = false;
309
+              this.getList();
312 310
             });
313 311
           } else {
314 312
             addData(this.form).then(response => {
315
-              if (response.code === 200) {
316
-                this.msgSuccess("新增成功");
317
-                this.open = false;
318
-                this.getList();
319
-              }
313
+              this.msgSuccess("新增成功");
314
+              this.open = false;
315
+              this.getList();
320 316
             });
321 317
           }
322 318
         }
@@ -334,7 +330,7 @@ export default {
334 330
         }).then(() => {
335 331
           this.getList();
336 332
           this.msgSuccess("删除成功");
337
-        }).catch(function() {});
333
+        })
338 334
     },
339 335
     /** 导出按钮操作 */
340 336
     handleExport() {

+ 8 - 16
ruoyi-ui/src/views/system/dict/index.vue

@@ -308,19 +308,15 @@ export default {
308 308
         if (valid) {
309 309
           if (this.form.dictId != undefined) {
310 310
             updateType(this.form).then(response => {
311
-              if (response.code === 200) {
312
-                this.msgSuccess("修改成功");
313
-                this.open = false;
314
-                this.getList();
315
-              }
311
+              this.msgSuccess("修改成功");
312
+              this.open = false;
313
+              this.getList();
316 314
             });
317 315
           } else {
318 316
             addType(this.form).then(response => {
319
-              if (response.code === 200) {
320
-                this.msgSuccess("新增成功");
321
-                this.open = false;
322
-                this.getList();
323
-              }
317
+              this.msgSuccess("新增成功");
318
+              this.open = false;
319
+              this.getList();
324 320
             });
325 321
           }
326 322
         }
@@ -338,7 +334,7 @@ export default {
338 334
         }).then(() => {
339 335
           this.getList();
340 336
           this.msgSuccess("删除成功");
341
-        }).catch(function() {});
337
+        })
342 338
     },
343 339
     /** 导出按钮操作 */
344 340
     handleExport() {
@@ -349,11 +345,7 @@ export default {
349 345
     /** 清理缓存按钮操作 */
350 346
     handleClearCache() {
351 347
       clearCache().then(response => {
352
-        if (response.code === 200) {
353
-          this.msgSuccess("清理成功");
354
-        } else {
355
-          this.msgError(response.msg);
356
-        }
348
+        this.msgSuccess("清理成功");
357 349
       });
358 350
     }
359 351
   }

+ 2 - 2
ruoyi-ui/src/views/system/logininfor/index.vue

@@ -193,7 +193,7 @@ export default {
193 193
         }).then(() => {
194 194
           this.getList();
195 195
           this.msgSuccess("删除成功");
196
-        }).catch(function() {});
196
+        })
197 197
     },
198 198
     /** 清空按钮操作 */
199 199
     handleClean() {
@@ -206,7 +206,7 @@ export default {
206 206
         }).then(() => {
207 207
           this.getList();
208 208
           this.msgSuccess("清空成功");
209
-        }).catch(function() {});
209
+        })
210 210
     },
211 211
     /** 导出按钮操作 */
212 212
     handleExport() {

+ 7 - 11
ruoyi-ui/src/views/system/menu/index.vue

@@ -367,19 +367,15 @@ export default {
367 367
         if (valid) {
368 368
           if (this.form.menuId != undefined) {
369 369
             updateMenu(this.form).then(response => {
370
-              if (response.code === 200) {
371
-                this.msgSuccess("修改成功");
372
-                this.open = false;
373
-                this.getList();
374
-              }
370
+              this.msgSuccess("修改成功");
371
+              this.open = false;
372
+              this.getList();
375 373
             });
376 374
           } else {
377 375
             addMenu(this.form).then(response => {
378
-              if (response.code === 200) {
379
-                this.msgSuccess("新增成功");
380
-                this.open = false;
381
-                this.getList();
382
-              }
376
+              this.msgSuccess("新增成功");
377
+              this.open = false;
378
+              this.getList();
383 379
             });
384 380
           }
385 381
         }
@@ -396,7 +392,7 @@ export default {
396 392
         }).then(() => {
397 393
           this.getList();
398 394
           this.msgSuccess("删除成功");
399
-        }).catch(function() {});
395
+        })
400 396
     }
401 397
   }
402 398
 };

+ 7 - 11
ruoyi-ui/src/views/system/notice/index.vue

@@ -307,19 +307,15 @@ export default {
307 307
         if (valid) {
308 308
           if (this.form.noticeId != undefined) {
309 309
             updateNotice(this.form).then(response => {
310
-              if (response.code === 200) {
311
-                this.msgSuccess("修改成功");
312
-                this.open = false;
313
-                this.getList();
314
-              }
310
+              this.msgSuccess("修改成功");
311
+              this.open = false;
312
+              this.getList();
315 313
             });
316 314
           } else {
317 315
             addNotice(this.form).then(response => {
318
-              if (response.code === 200) {
319
-                this.msgSuccess("新增成功");
320
-                this.open = false;
321
-                this.getList();
322
-              }
316
+              this.msgSuccess("新增成功");
317
+              this.open = false;
318
+              this.getList();
323 319
             });
324 320
           }
325 321
         }
@@ -337,7 +333,7 @@ export default {
337 333
         }).then(() => {
338 334
           this.getList();
339 335
           this.msgSuccess("删除成功");
340
-        }).catch(function() {});
336
+        })
341 337
     }
342 338
   }
343 339
 };

+ 2 - 2
ruoyi-ui/src/views/system/operlog/index.vue

@@ -283,7 +283,7 @@ export default {
283 283
         }).then(() => {
284 284
           this.getList();
285 285
           this.msgSuccess("删除成功");
286
-        }).catch(function() {});
286
+        })
287 287
     },
288 288
     /** 清空按钮操作 */
289 289
     handleClean() {
@@ -296,7 +296,7 @@ export default {
296 296
         }).then(() => {
297 297
           this.getList();
298 298
           this.msgSuccess("清空成功");
299
-        }).catch(function() {});
299
+        })
300 300
     },
301 301
     /** 导出按钮操作 */
302 302
     handleExport() {

+ 7 - 11
ruoyi-ui/src/views/system/post/index.vue

@@ -276,19 +276,15 @@ export default {
276 276
         if (valid) {
277 277
           if (this.form.postId != undefined) {
278 278
             updatePost(this.form).then(response => {
279
-              if (response.code === 200) {
280
-                this.msgSuccess("修改成功");
281
-                this.open = false;
282
-                this.getList();
283
-              }
279
+              this.msgSuccess("修改成功");
280
+              this.open = false;
281
+              this.getList();
284 282
             });
285 283
           } else {
286 284
             addPost(this.form).then(response => {
287
-              if (response.code === 200) {
288
-                this.msgSuccess("新增成功");
289
-                this.open = false;
290
-                this.getList();
291
-              }
285
+              this.msgSuccess("新增成功");
286
+              this.open = false;
287
+              this.getList();
292 288
             });
293 289
           }
294 290
         }
@@ -306,7 +302,7 @@ export default {
306 302
         }).then(() => {
307 303
           this.getList();
308 304
           this.msgSuccess("删除成功");
309
-        }).catch(function() {});
305
+        })
310 306
     },
311 307
     /** 导出按钮操作 */
312 308
     handleExport() {

+ 10 - 16
ruoyi-ui/src/views/system/role/index.vue

@@ -537,20 +537,16 @@ export default {
537 537
           if (this.form.roleId != undefined) {
538 538
             this.form.menuIds = this.getMenuAllCheckedKeys();
539 539
             updateRole(this.form).then(response => {
540
-              if (response.code === 200) {
541
-                this.msgSuccess("修改成功");
542
-                this.open = false;
543
-                this.getList();
544
-              }
540
+              this.msgSuccess("修改成功");
541
+              this.open = false;
542
+              this.getList();
545 543
             });
546 544
           } else {
547 545
             this.form.menuIds = this.getMenuAllCheckedKeys();
548 546
             addRole(this.form).then(response => {
549
-              if (response.code === 200) {
550
-                this.msgSuccess("新增成功");
551
-                this.open = false;
552
-                this.getList();
553
-              }
547
+              this.msgSuccess("新增成功");
548
+              this.open = false;
549
+              this.getList();
554 550
             });
555 551
           }
556 552
         }
@@ -561,11 +557,9 @@ export default {
561 557
       if (this.form.roleId != undefined) {
562 558
         this.form.deptIds = this.getDeptAllCheckedKeys();
563 559
         dataScope(this.form).then(response => {
564
-          if (response.code === 200) {
565
-            this.msgSuccess("修改成功");
566
-            this.openDataScope = false;
567
-            this.getList();
568
-          }
560
+          this.msgSuccess("修改成功");
561
+          this.openDataScope = false;
562
+          this.getList();
569 563
         });
570 564
       }
571 565
     },
@@ -581,7 +575,7 @@ export default {
581 575
         }).then(() => {
582 576
           this.getList();
583 577
           this.msgSuccess("删除成功");
584
-        }).catch(function() {});
578
+        })
585 579
     },
586 580
     /** 导出按钮操作 */
587 581
     handleExport() {

+ 8 - 14
ruoyi-ui/src/views/system/user/index.vue

@@ -582,9 +582,7 @@ export default {
582 582
         cancelButtonText: "取消"
583 583
       }).then(({ value }) => {
584 584
           resetUserPwd(row.userId, value).then(response => {
585
-            if (response.code === 200) {
586
-              this.msgSuccess("修改成功,新密码是:" + value);
587
-            }
585
+            this.msgSuccess("修改成功,新密码是:" + value);
588 586
           });
589 587
         }).catch(() => {});
590 588
     },
@@ -594,19 +592,15 @@ export default {
594 592
         if (valid) {
595 593
           if (this.form.userId != undefined) {
596 594
             updateUser(this.form).then(response => {
597
-              if (response.code === 200) {
598
-                this.msgSuccess("修改成功");
599
-                this.open = false;
600
-                this.getList();
601
-              }
595
+              this.msgSuccess("修改成功");
596
+              this.open = false;
597
+              this.getList();
602 598
             });
603 599
           } else {
604 600
             addUser(this.form).then(response => {
605
-              if (response.code === 200) {
606
-                this.msgSuccess("新增成功");
607
-                this.open = false;
608
-                this.getList();
609
-              }
601
+              this.msgSuccess("新增成功");
602
+              this.open = false;
603
+              this.getList();
610 604
             });
611 605
           }
612 606
         }
@@ -624,7 +618,7 @@ export default {
624 618
         }).then(() => {
625 619
           this.getList();
626 620
           this.msgSuccess("删除成功");
627
-        }).catch(function() {});
621
+        })
628 622
     },
629 623
     /** 导出按钮操作 */
630 624
     handleExport() {

+ 1 - 3
ruoyi-ui/src/views/system/user/profile/resetPwd.vue

@@ -57,9 +57,7 @@ export default {
57 57
         if (valid) {
58 58
           updateUserPwd(this.user.oldPassword, this.user.newPassword).then(
59 59
             response => {
60
-              if (response.code === 200) {
61
-                this.msgSuccess("修改成功");
62
-              }
60
+              this.msgSuccess("修改成功");
63 61
             }
64 62
           );
65 63
         }

+ 4 - 6
ruoyi-ui/src/views/system/user/profile/userAvatar.vue

@@ -125,12 +125,10 @@ export default {
125 125
         let formData = new FormData();
126 126
         formData.append("avatarfile", data);
127 127
         uploadAvatar(formData).then(response => {
128
-          if (response.code === 200) {
129
-            this.open = false;
130
-            this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
131
-            store.commit('SET_AVATAR', this.options.img);
132
-            this.msgSuccess("修改成功");
133
-          }
128
+          this.open = false;
129
+          this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
130
+          store.commit('SET_AVATAR', this.options.img);
131
+          this.msgSuccess("修改成功");
134 132
           this.visible = false;
135 133
         });
136 134
       });

+ 1 - 3
ruoyi-ui/src/views/system/user/profile/userInfo.vue

@@ -62,9 +62,7 @@ export default {
62 62
       this.$refs["form"].validate(valid => {
63 63
         if (valid) {
64 64
           updateUserProfile(this.user).then(response => {
65
-            if (response.code === 200) {
66
-              this.msgSuccess("修改成功");
67
-            }
65
+            this.msgSuccess("修改成功");
68 66
           });
69 67
         }
70 68
       });

+ 2 - 2
ruoyi-ui/src/views/tool/gen/index.vue

@@ -270,7 +270,7 @@ export default {
270 270
           return synchDb(tableName);
271 271
       }).then(() => {
272 272
           this.msgSuccess("同步成功");
273
-      }).catch(function() {});
273
+      })
274 274
     },
275 275
     /** 打开导入表弹窗 */
276 276
     openImportTable() {
@@ -313,7 +313,7 @@ export default {
313 313
       }).then(() => {
314 314
           this.getList();
315 315
           this.msgSuccess("删除成功");
316
-      }).catch(function() {});
316
+      })
317 317
     }
318 318
   }
319 319
 };