bihuisong пре 1 година
родитељ
комит
704497de28

+ 6 - 6
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SecurityController.java

@@ -61,12 +61,12 @@ public class SecurityController {
     @ResponseBody
     public AjaxResult getToken(@RequestBody TokenRequest form) {
         //解密密码字符串
-//        String privateKey = redisService.getCacheObject("remoteSecretKey");
-//        try {
-//            RsaUtil.decrypt(form.getUsername(), privateKey);
-//        } catch (Exception e) {
-//            return AjaxResult.error("获取token失败").put("data", null).put("code",40002);
-//        }
+        String privateKey = redisService.getCacheObject("remoteSecretKey");
+        try {
+            RsaUtil.decrypt(form.getUsername(), privateKey);
+        } catch (Exception e) {
+            return AjaxResult.error("获取token失败").put("data", null).put("code",40002);
+        }
         SysUser user = userService.selectUserByLoginName(form.getUsername());
         String token = JwtUtils.createToken(form.getUsername(), user.getPassword());
         try {

+ 36 - 44
ruoyi-admin/src/main/resources/templates/websiteAccess.html

@@ -359,7 +359,6 @@
       // 基于准备好的dom,初始化echarts实例
       var myChart = echarts.init(document.getElementById("chart-panel3"));
       let dataSourceThree = [[${dataSourceThree}]];
-      console.log("dataSourceThree",dataSourceThree)
       function getPageList(arrays, pageNum, pageSize) {
         //计算分页页数
         pageNum = pageNum - 1;
@@ -383,15 +382,15 @@
       var pageNum = 1,
               pageSize = 10;
       var baseRows = getPageList(yLabel, pageNum, pageSize);
-      console.log("baseRows",baseRows)
-      let yData = [];
-      baseRows.forEach((item,index) => {
-        // baseRows.push(item)
-        yData.push(dataSourceThree.browseList[index]);
-      });
+      var data = getPageList(dataSourceThree.browseList, pageNum, pageSize);
+      let yData = data;
+      // baseRows.forEach((item,index) => {
+      //   // baseRows.push(item)
+      //   yData.push(dataSourceThree.browseList[index]);
+      // });
       let bgData = [];
       for (let i in yData) {
-        bgData.push(400);
+        bgData.push(Math.max(...yData));
       }
 
       var option = {
@@ -502,29 +501,30 @@
         ],
       };
 
-      setInterval(() => {
+     var j=  setInterval(() => {
         pageNum++;
         var rows = getPageList(yLabel, pageSize + pageNum, 1);
+        var data = getPageList(dataSourceThree.browseList, pageSize + pageNum, 1);
         if (rows.length == 0) {
           pageSize = 0;
           pageNum = 0;
           return;
         }
-        //原始数组
-        baseRows.splice(0, 1);
-        // baseRows.push(...rows);
-        //原始数组y刻度值
-        yData.splice(0, 1);
         rows.forEach((item,index) => {
           baseRows.push(item)
-          yData.push(yData[index]);
-          console.log(item,dataSourceThree.browseList[index])
         });
-        console.log("dataSourceThree.browseList",yData)
+       data.forEach((item,index) => {
+         yData.push(item);
+       });
+       //原始数组
+       baseRows.splice(0, 1);
+       // baseRows.push(...rows);
+       //原始数组y刻度值
+       yData.splice(0, 1);
         //x轴
         bgData.splice(0, 1);
         rows.forEach((item) => {
-          bgData.push(400);
+          bgData.push(Math.max(...yData));
         });
 
         myChart.setOption({
@@ -547,7 +547,7 @@
             },
           ],
         });
-      }, 1000);
+      }, 3000);
 
       if (option) {
         myChart.setOption(option);
@@ -849,10 +849,8 @@
         }
         if (10018 == JSON.parse(res).code) {
           message = JSON.parse(res).data
-          console.log("message",message)
           // 基于准备好的dom,初始化echarts实例
           var myChart = echarts.init(document.getElementById("chart-panel3"));
-          console.log("message",message)
           function getPageList(arrays, pageNum, pageSize) {
             //计算分页页数
             pageNum = pageNum - 1;
@@ -871,22 +869,16 @@
             }
             return dataList;
           }
-
           let yLabel = message.columnRankingList;
           var pageNum = 1,
                   pageSize = 10;
           var baseRows = getPageList(yLabel, pageNum, pageSize);
-          console.log("baseRows",baseRows)
-          let yData = [];
-          baseRows.forEach((item,index) => {
-            // baseRows.push(item)
-            yData.push(message.browseList[index]);
-          });
+          var Data = getPageList(message.browseList, pageNum, pageSize);
+          let yData = Data;
           let bgData = [];
           for (let i in yData) {
-            bgData.push(400);
+            bgData.push(Math.max(...yData));
           }
-
           var option = {
             grid: {
               left: "5%",
@@ -994,32 +986,32 @@
               },
             ],
           };
-
-          setInterval(() => {
+          clearInterval(j)
+          j=setInterval(() => {
             pageNum++;
             var rows = getPageList(yLabel, pageSize + pageNum, 1);
+            var data = getPageList(message.browseList, pageSize + pageNum, 1);
             if (rows.length == 0) {
               pageSize = 0;
               pageNum = 0;
               return;
             }
-            //原始数组
-            baseRows.splice(0, 1);
-            // baseRows.push(...rows);
-            //原始数组y刻度值
-            yData.splice(0, 1);
             rows.forEach((item,index) => {
               baseRows.push(item)
-              yData.push(yData[index]);
-              console.log(item,message.browseList[index])
             });
-            console.log("dataSourceThree.browseList",yData)
+            data.forEach((item,index) => {
+              yData.push(item)
+            });
+            //原始数组
+            yData.splice(0,1)
+            // baseRows.push(...rows);
+            //原始数组y刻度值
+            baseRows.splice(0, 1);
             //x轴
             bgData.splice(0, 1);
             rows.forEach((item) => {
-              bgData.push(400);
+              bgData.push(Math.max(...yData));
             });
-
             myChart.setOption({
               yAxis: [
                 {
@@ -1040,10 +1032,10 @@
                 },
               ],
             });
-          }, 1000);
+          }, 3000);
 
           if (option) {
-            myChart.clear()
+           myChart.clear()
             myChart.setOption(option);
           }
         }