Browse Source

增加系统信息轮询

pixel 4 years ago
parent
commit
8848ee9ac5

+ 7 - 6
web/src/utils/stringFun.js

@@ -1,3 +1,4 @@
+/* eslint-disable */
 export const toUpperCase = (str) => {
     if (str[0]) {
         return str.replace(str[0], str[0].toUpperCase())
@@ -8,13 +9,13 @@ export const toUpperCase = (str) => {
 
 // 驼峰转换下划线
 export const toSQLLine = (str) => {
-    if (str=="ID") return "ID"
-    return str.replace(/([A-Z])/g,"_$1").toLowerCase();
-  }
+    if (str == "ID") return "ID"
+    return str.replace(/([A-Z])/g, "_$1").toLowerCase();
+}
 
-  // 下划线转换驼峰
-  export const  toHump = (name) => {
-    return name.replace(/\_(\w)/g, function(all, letter){
+// 下划线转换驼峰
+export const toHump = (name) => {
+    return name.replace(/\_(\w)/g, function(all, letter) {
         return letter.toUpperCase();
     });
 }

+ 1 - 1
web/src/view/superAdmin/authority/components/apis.vue

@@ -54,7 +54,7 @@ export default {
       apis &&
         apis.map(item => {
         item.onlyId = "p:"+item.path+"m:"+item.method
-          if (apiObj.hasOwnProperty(item.apiGroup)) {
+          if (Object.prototype.hasOwnProperty.call(apiObj,item.apiGroup)) {
             apiObj[item.apiGroup].push(item)
           } else {
             Object.assign(apiObj, { [item.apiGroup]: [item] })

+ 4 - 1
web/src/view/system/state.vue

@@ -146,8 +146,11 @@ export default {
       ],
     };
   },
-  created() {
+  created() { 
     this.reload();
+    setInterval(() => {
+      this.reload();
+    }, 1000*10);
   },
   methods: {
     async reload() {