Bläddra i källkod

Merge branch '20221012_sun新增加密逻辑避免XSS' of sckj/mz-cloud into master

15143018065 1 år sedan
förälder
incheckning
99bfac66f5

+ 12 - 0
ruoyi-modules/mz-portal/src/main/java/com/ruoyi/portal/controller/MhZcXwController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.portal.controller;
 
+import cn.hutool.core.codec.Base64;
 import com.ruoyi.common.core.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
@@ -330,6 +331,7 @@ public class MhZcXwController extends BaseController
     @PostMapping
     public AjaxResult add(@Validated({AddGroup.class}) @RequestBody MhZcXw mhZcXw)
     {
+        mhZcXw.setNr(Base64.decodeStr(mhZcXw.getNr()));
         return toAjax(mhZcXwService.insertMhZcXw(mhZcXw),mhZcXw.getId());
     }
 
@@ -341,6 +343,7 @@ public class MhZcXwController extends BaseController
     @PostMapping("/zc")
     public AjaxResult zcAdd(@Validated({AddGroup.class}) @RequestBody MhZcXw mhZcXw)
     {
+        mhZcXw.setNr(Base64.decodeStr(mhZcXw.getNr()));
         mhZcXw.setMkqf(PortalEnums.POLICY.getCode());
         return toAjax(mhZcXwService.insertMhZcXw(mhZcXw),mhZcXw.getId());
     }
@@ -353,6 +356,7 @@ public class MhZcXwController extends BaseController
     @PostMapping("/gh")
     public AjaxResult ghAdd(@Validated({AddGroup.class}) @RequestBody MhZcXw mhZcXw)
     {
+        mhZcXw.setNr(Base64.decodeStr(mhZcXw.getNr()));
         mhZcXw.setMkqf(PortalEnums.PLAN.getCode());
         return toAjax(mhZcXwService.insertMhZcXw(mhZcXw),mhZcXw.getId());
     }
@@ -365,6 +369,7 @@ public class MhZcXwController extends BaseController
     @PostMapping("/ll")
     public AjaxResult llAdd(@Validated({AddGroup.class}) @RequestBody MhZcXw mhZcXw)
     {
+        mhZcXw.setNr(Base64.decodeStr(mhZcXw.getNr()));
         mhZcXw.setMkqf(PortalEnums.AGING.getCode());
         return toAjax(mhZcXwService.insertMhZcXw(mhZcXw),mhZcXw.getId());
     }
@@ -377,6 +382,7 @@ public class MhZcXwController extends BaseController
     @PostMapping("/fw")
     public AjaxResult fwAdd(@Validated({AddGroup.class}) @RequestBody MhZcXw mhZcXw)
     {
+        mhZcXw.setNr(Base64.decodeStr(mhZcXw.getNr()));
         mhZcXw.setMkqf(PortalEnums.SERVICE.getCode());
         return toAjax(mhZcXwService.insertMhZcXw(mhZcXw),mhZcXw.getId());
     }
@@ -389,6 +395,7 @@ public class MhZcXwController extends BaseController
     @PostMapping("/sy")
     public AjaxResult syAdd(@Validated({AddGroup.class}) @RequestBody MhZcXw mhZcXw)
     {
+        mhZcXw.setNr(Base64.decodeStr(mhZcXw.getNr()));
         mhZcXw.setMkqf(PortalEnums.PRAINF.getCode());
         return toAjax(mhZcXwService.insertMhZcXw(mhZcXw),mhZcXw.getId());
     }
@@ -401,6 +408,7 @@ public class MhZcXwController extends BaseController
     @PostMapping("/hy")
     public AjaxResult hyAdd(@Validated({AddGroup.class}) @RequestBody MhZcXw mhZcXw)
     {
+        mhZcXw.setNr(Base64.decodeStr(mhZcXw.getNr()));
         mhZcXw.setMkqf(PortalEnums.MANAGEMENT.getCode());
         return toAjax(mhZcXwService.insertMhZcXw(mhZcXw),mhZcXw.getId());
     }
@@ -413,6 +421,7 @@ public class MhZcXwController extends BaseController
     @PostMapping("/lb")
     public AjaxResult lbAdd(@Validated({AddGroup.class}) @RequestBody MhZcXw mhZcXw)
     {
+        mhZcXw.setNr(Base64.decodeStr(mhZcXw.getNr()));
         mhZcXw.setMkqf(PortalEnums.RCHART.getCode());
         return toAjax(mhZcXwService.insertMhZcXw(mhZcXw),mhZcXw.getId());
     }
@@ -425,6 +434,7 @@ public class MhZcXwController extends BaseController
     @PostMapping("/wl")
     public AjaxResult wlAdd(@Validated({AddGroup.class}) @RequestBody MhZcXw mhZcXw)
     {
+        mhZcXw.setNr(Base64.decodeStr(mhZcXw.getNr()));
         mhZcXw.setMkqf(PortalEnums.EXTERNAL.getCode());
         return toAjax(mhZcXwService.insertMhZcXw(mhZcXw),mhZcXw.getId());
     }
@@ -437,6 +447,7 @@ public class MhZcXwController extends BaseController
     @PostMapping("/bs")
     public AjaxResult bsAdd(@Validated({AddGroup.class}) @RequestBody MhZcXw mhZcXw)
     {
+        mhZcXw.setNr(Base64.decodeStr(mhZcXw.getNr()));
         mhZcXw.setMkqf(PortalEnums.HANDLE.getCode());
         return toAjax(mhZcXwService.insertMhZcXw(mhZcXw),mhZcXw.getId());
     }
@@ -449,6 +460,7 @@ public class MhZcXwController extends BaseController
     @PutMapping
     public AjaxResult edit(@Validated @RequestBody MhZcXw mhZcXw)
     {
+        mhZcXw.setNr(Base64.decodeStr(mhZcXw.getNr()));
         return toAjax(mhZcXwService.updateMhZcXw(mhZcXw));
     }
 

+ 4 - 2
ruoyi-ui/src/views/portal/bszn/index.vue

@@ -127,6 +127,7 @@
 
 <script>
 import {addMhBs, delMhZcxw, getMhZcxw, listMhBs, updateMhZcxw, updateState} from "@/api/portal/mhZcxw";
+var Base64 = Base64 || require('@/api/tool/base64.js').Base64;
 
 export default {
   name: "MhZcxw",
@@ -287,11 +288,12 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid) {
           this.submitFormLoading = true;
+          const newNr = Base64.encode(this.form.nr);
           if (this.form.id != null) {
             /****** sks 需要改动的地方 start ******/
             let formData = this.comparisonObject(this.form, this.copyForm);
             if (formData) {
-              updateMhZcxw({ ...formData, id: this.form.id }).then(response => {
+              updateMhZcxw({ ...formData, id: this.form.id, nr: newNr}).then(response => {
                 this.$modal.msgSuccess("修改成功");
                 this.open = false;
                 this.mhZcxwList = this.dataReplacement(this.mhZcxwList, this.form.id, formData);
@@ -304,7 +306,7 @@ export default {
             }
             /****** sks 需要改动的地方 end ******/
           } else {
-            addMhBs(this.form).then(response => {
+            addMhBs({...this.form, nr: newNr}).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               // this.getList();

+ 4 - 2
ruoyi-ui/src/views/portal/fwxm/index.vue

@@ -93,6 +93,7 @@
 
 <script>
 import {addMhFw, delMhZcxw, getMhZcxw, listMhFw, updateMhZcxw, updateState} from "@/api/portal/mhZcxw";
+var Base64 = Base64 || require('@/api/tool/base64.js').Base64;
 
 export default {
   name: "MhZcxw",
@@ -251,11 +252,12 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid) {
           this.submitFormLoading = true;
+          const newNr = Base64.encode(this.form.nr);
           if (this.form.id != null) {
             /****** sks 需要改动的地方 start ******/
             let formData = this.comparisonObject(this.form, this.copyForm);
             if (formData) {
-              updateMhZcxw({ ...formData, id: this.form.id }).then(response => {
+              updateMhZcxw({ ...formData, id: this.form.id, nr: newNr }).then(response => {
                 this.$modal.msgSuccess("修改成功");
                 this.open = false;
                 this.mhZcxwList = this.dataReplacement(this.mhZcxwList, this.form.id, formData);
@@ -268,7 +270,7 @@ export default {
             }
             /****** sks 需要改动的地方 end ******/
           } else {
-            addMhFw(this.form).then(response => {
+            addMhFw({...this.form, nr: newNr}).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               // this.getList();

+ 4 - 2
ruoyi-ui/src/views/portal/ghbg/index.vue

@@ -93,6 +93,7 @@
 
 <script>
 import {addMhGh, delMhZcxw, getMhZcxw, listMhGh, updateMhZcxw, updateState} from "@/api/portal/mhZcxw";
+var Base64 = Base64 || require('@/api/tool/base64.js').Base64;
 
 export default {
   name: "MhZcxw",
@@ -251,11 +252,12 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid) {
           this.submitFormLoading = true;
+          const newNr = Base64.encode(this.form.nr);
           if (this.form.id != null) {
             /****** sks 需要改动的地方 start ******/
             let formData = this.comparisonObject(this.form, this.copyForm);
             if (formData) {
-              updateMhZcxw({ ...formData, id: this.form.id }).then(response => {
+              updateMhZcxw({ ...formData, id: this.form.id, nr: newNr }).then(response => {
                 this.$modal.msgSuccess("修改成功");
                 this.open = false;
                 this.mhZcxwList = this.dataReplacement(this.mhZcxwList, this.form.id, formData);
@@ -268,7 +270,7 @@ export default {
             }
             /****** sks 需要改动的地方 end ******/
           } else {
-            addMhGh(this.form).then(response => {
+            addMhGh({...this.form, nr: newNr}).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               // this.getList();

+ 4 - 2
ruoyi-ui/src/views/portal/hygl/index.vue

@@ -93,6 +93,7 @@
 
 <script>
 import {addMhHy, delMhZcxw, getMhZcxw, listMhHy, updateMhZcxw, updateState} from "@/api/portal/mhZcxw";
+var Base64 = Base64 || require('@/api/tool/base64.js').Base64;
 
 export default {
   name: "MhZcxw",
@@ -251,11 +252,12 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid) {
           this.submitFormLoading = true;
+          const newNr = Base64.encode(this.form.nr);
           if (this.form.id != null) {
             /****** sks 需要改动的地方 start ******/
             let formData = this.comparisonObject(this.form, this.copyForm);
             if (formData) {
-              updateMhZcxw({ ...formData, id: this.form.id }).then(response => {
+              updateMhZcxw({ ...formData, id: this.form.id, nr: newNr }).then(response => {
                 this.$modal.msgSuccess("修改成功");
                 this.open = false;
                 this.mhZcxwList = this.dataReplacement(this.mhZcxwList, this.form.id, formData);
@@ -268,7 +270,7 @@ export default {
             }
             /****** sks 需要改动的地方 end ******/
           } else {
-            addMhHy(this.form).then(response => {
+            addMhHy({...this.form, nr: newNr}).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               // this.getList();

+ 4 - 2
ruoyi-ui/src/views/portal/lbt/index.vue

@@ -104,6 +104,7 @@
 
 <script>
 import {addMhLb, delMhZcxw, getMhZcxw, listMhLb, updateMhZcxw, updateState} from "@/api/portal/mhZcxw";
+var Base64 = Base64 || require('@/api/tool/base64.js').Base64;
 
 export default {
   name: "MhZcxw",
@@ -263,11 +264,12 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid) {
           this.submitFormLoading = true;
+          const newNr = Base64.encode(this.form.nr);
           if (this.form.id != null) {
             /****** sks 需要改动的地方 start ******/
             let formData = this.comparisonObject(this.form, this.copyForm);
             if (formData) {
-              updateMhZcxw({ ...formData, id: this.form.id }).then(response => {
+              updateMhZcxw({ ...formData, id: this.form.id, nr: newNr }).then(response => {
                 this.$modal.msgSuccess("修改成功");
                 this.open = false;
                 this.mhZcxwList = this.dataReplacement(this.mhZcxwList, this.form.id, formData);
@@ -280,7 +282,7 @@ export default {
             }
             /****** sks 需要改动的地方 end ******/
           } else {
-            addMhLb(this.form).then(response => {
+            addMhLb({...this.form, nr: newNr}).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               // this.getList();

+ 4 - 2
ruoyi-ui/src/views/portal/llsj/index.vue

@@ -93,6 +93,7 @@
 
 <script>
 import {addMhLl, delMhZcxw, getMhZcxw, listMhLl, updateMhZcxw, updateState} from "@/api/portal/mhZcxw";
+var Base64 = Base64 || require('@/api/tool/base64.js').Base64;
 
 export default {
   name: "MhZcxw",
@@ -251,11 +252,12 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid) {
           this.submitFormLoading = true;
+          const newNr = Base64.encode(this.form.nr);
           if (this.form.id != null) {
             /****** sks 需要改动的地方 start ******/
             let formData = this.comparisonObject(this.form, this.copyForm);
             if (formData) {
-              updateMhZcxw({ ...formData, id: this.form.id }).then(response => {
+              updateMhZcxw({ ...formData, id: this.form.id, nr: newNr }).then(response => {
                 this.$modal.msgSuccess("修改成功");
                 this.open = false;
                 this.mhZcxwList = this.dataReplacement(this.mhZcxwList, this.form.id, formData);
@@ -268,7 +270,7 @@ export default {
             }
             /****** sks 需要改动的地方 end ******/
           } else {
-            addMhLl(this.form).then(response => {
+            addMhLl({...this.form, nr: newNr}).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               // this.getList();

+ 4 - 2
ruoyi-ui/src/views/portal/mhZc/index.vue

@@ -155,6 +155,7 @@
 
 <script>
 import {addMhZc, delMhZcxw, getMhZcxw, listMhZc, updateMhZcxw, updateState} from "@/api/portal/mhZcxw";
+var Base64 = Base64 || require('@/api/tool/base64.js').Base64;
 
 export default {
   name: "MhZcxw",
@@ -316,11 +317,12 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid) {
           this.submitFormLoading = true;
+          const newNr = Base64.encode(this.form.nr);
           if (this.form.id != null) {
             /****** sks 需要改动的地方 start ******/
             let formData = this.comparisonObject(this.form, this.copyForm);
             if (formData) {
-              updateMhZcxw({ ...formData, id: this.form.id }).then(response => {
+              updateMhZcxw({ ...formData, id: this.form.id, nr: newNr }).then(response => {
                 this.$modal.msgSuccess("修改成功");
                 this.open = false;
                 this.mhZcxwList = this.dataReplacement(this.mhZcxwList, this.form.id, formData);
@@ -333,7 +335,7 @@ export default {
             }
             /****** sks 需要改动的地方 end ******/
           } else {
-            addMhZc(this.form).then(response => {
+            addMhZc({...this.form, nr: newNr}).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               // this.getList();

+ 4 - 2
ruoyi-ui/src/views/portal/syxx/index.vue

@@ -99,6 +99,7 @@
 
 <script>
 import {addMhSy, delMhZcxw, getMhZcxw, listMhSy, updateMhZcxw, updateState} from "@/api/portal/mhZcxw";
+var Base64 = Base64 || require('@/api/tool/base64.js').Base64;
 
 export default {
   name: "MhZcxw",
@@ -258,11 +259,12 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid) {
           this.submitFormLoading = true;
+          const newNr = Base64.encode(this.form.nr);
           if (this.form.id != null) {
             /****** sks 需要改动的地方 start ******/
             let formData = this.comparisonObject(this.form, this.copyForm);
             if (formData) {
-              updateMhZcxw({ ...formData, id: this.form.id }).then(response => {
+              updateMhZcxw({ ...formData, id: this.form.id, nr: newNr }).then(response => {
                 this.$modal.msgSuccess("修改成功");
                 this.open = false;
                 this.mhZcxwList = this.dataReplacement(this.mhZcxwList, this.form.id, formData);
@@ -275,7 +277,7 @@ export default {
             }
             /****** sks 需要改动的地方 end ******/
           } else {
-            addMhSy(this.form).then(response => {
+            addMhSy({...this.form, nr: newNr}).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               // this.getList();

+ 4 - 2
ruoyi-ui/src/views/portal/wlj/index.vue

@@ -78,6 +78,7 @@
 
 <script>
 import {addMhWl, delMhZcxw, getMhZcxw, listMhWl, updateMhZcxw, updateState} from "@/api/portal/mhZcxw";
+var Base64 = Base64 || require('@/api/tool/base64.js').Base64;
 
 export default {
   name: "MhZcxw",
@@ -237,11 +238,12 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid) {
           this.submitFormLoading = true;
+          const newNr = Base64.encode(this.form.nr);
           if (this.form.id != null) {
             /****** sks 需要改动的地方 start ******/
             let formData = this.comparisonObject(this.form, this.copyForm);
             if (formData) {
-              updateMhZcxw({ ...formData, id: this.form.id }).then(response => {
+              updateMhZcxw({ ...formData, id: this.form.id, nr: newNr }).then(response => {
                 this.$modal.msgSuccess("修改成功");
                 this.open = false;
                 this.mhZcxwList = this.dataReplacement(this.mhZcxwList, this.form.id, formData);
@@ -254,7 +256,7 @@ export default {
             }
             /****** sks 需要改动的地方 end ******/
           } else {
-            addMhWl(this.form).then(response => {
+            addMhWl({...this.form, nr: newNr}).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               // this.getList();