Browse Source

基础配置调整,主页菜单接口接入

chenwen 2 năm trước cách đây
mục cha
commit
dc93e33a8f

+ 100 - 100
package-lock.json

@@ -191,52 +191,52 @@
       "integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q=="
     },
     "@vue/reactivity": {
-      "version": "3.2.30",
-      "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.30.tgz",
-      "integrity": "sha512-qlNKbkRn2JiGxVUEdoXbLAy+vcuHUCcq+YH2uXWz0BNMvXY2plmz+oqsw+694llwmYLkke5lbdYF4DIupisIkg==",
+      "version": "3.2.40",
+      "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.40.tgz",
+      "integrity": "sha512-N9qgGLlZmtUBMHF9xDT4EkD9RdXde1Xbveb+niWMXuHVWQP5BzgRmE3SFyUBBcyayG4y1lhoz+lphGRRxxK4RA==",
       "requires": {
-        "@vue/shared": "3.2.30"
+        "@vue/shared": "3.2.40"
       },
       "dependencies": {
         "@vue/shared": {
-          "version": "3.2.30",
-          "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.30.tgz",
-          "integrity": "sha512-B3HouBtUxcfu2w2d+VhdLcVBXKYYhXiFMAfQ+hoe8NUhKkPRkWDIqhpuehCZxVQ3S2dN1P1WfKGlxGC+pfmxGg=="
+          "version": "3.2.40",
+          "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.40.tgz",
+          "integrity": "sha512-0PLQ6RUtZM0vO3teRfzGi4ltLUO5aO+kLgwh4Um3THSR03rpQWLTuRCkuO5A41ITzwdWeKdPHtSARuPkoo5pCQ=="
         }
       }
     },
     "@vue/reactivity-transform": {
-      "version": "3.2.30",
-      "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.2.30.tgz",
-      "integrity": "sha512-Le5XzCJyK3qTjoTnvQG/Ehu8fYjayauMNFyMaEnwFlm/avDofpuibpS9u+/6AgzsGnVWN+i0Jgf25bJd9DIwMw==",
+      "version": "3.2.40",
+      "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.2.40.tgz",
+      "integrity": "sha512-HQUCVwEaacq6fGEsg2NUuGKIhUveMCjOk8jGHqLXPI2w6zFoPrlQhwWEaINTv5kkZDXKEnCijAp+4gNEHG03yw==",
       "requires": {
         "@babel/parser": "^7.16.4",
-        "@vue/compiler-core": "3.2.30",
-        "@vue/shared": "3.2.30",
+        "@vue/compiler-core": "3.2.40",
+        "@vue/shared": "3.2.40",
         "estree-walker": "^2.0.2",
         "magic-string": "^0.25.7"
       },
       "dependencies": {
         "@babel/parser": {
-          "version": "7.21.2",
-          "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.2.tgz",
-          "integrity": "sha512-URpaIJQwEkEC2T9Kn+Ai6Xe/02iNaVCuT/PtoRz3GPVJVDpPd7mLo+VddTbhCRU9TXqW5mSrQfXZyi8kDKOVpQ=="
+          "version": "7.21.3",
+          "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.3.tgz",
+          "integrity": "sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ=="
         },
         "@vue/compiler-core": {
-          "version": "3.2.30",
-          "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.30.tgz",
-          "integrity": "sha512-64fq1KfcR+k3Vlw+IsBM2VhV5B+2IP3YxvKU8LWCDLrkmlXtbf2eMK6+0IwX5KP41D0f1gzryIiXR7P8cB9O5Q==",
+          "version": "3.2.40",
+          "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.40.tgz",
+          "integrity": "sha512-2Dc3Stk0J/VyQ4OUr2yEC53kU28614lZS+bnrCbFSAIftBJ40g/2yQzf4mPBiFuqguMB7hyHaujdgZAQ67kZYA==",
           "requires": {
             "@babel/parser": "^7.16.4",
-            "@vue/shared": "3.2.30",
+            "@vue/shared": "3.2.40",
             "estree-walker": "^2.0.2",
             "source-map": "^0.6.1"
           }
         },
         "@vue/shared": {
-          "version": "3.2.30",
-          "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.30.tgz",
-          "integrity": "sha512-B3HouBtUxcfu2w2d+VhdLcVBXKYYhXiFMAfQ+hoe8NUhKkPRkWDIqhpuehCZxVQ3S2dN1P1WfKGlxGC+pfmxGg=="
+          "version": "3.2.40",
+          "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.40.tgz",
+          "integrity": "sha512-0PLQ6RUtZM0vO3teRfzGi4ltLUO5aO+kLgwh4Um3THSR03rpQWLTuRCkuO5A41ITzwdWeKdPHtSARuPkoo5pCQ=="
         }
       }
     },
@@ -254,85 +254,85 @@
       }
     },
     "@vue/runtime-core": {
-      "version": "3.2.30",
-      "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.30.tgz",
-      "integrity": "sha512-RTi7xH0Ht/6wfbo2WFBMJTEiyWFTqGhrksJm8lz6E+auO6lXZ6Eq3gPNfLt47GDWCm4xyrv+rs5R4UbarPEQ1Q==",
+      "version": "3.2.40",
+      "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.40.tgz",
+      "integrity": "sha512-U1+rWf0H8xK8aBUZhnrN97yoZfHbjgw/bGUzfgKPJl69/mXDuSg8CbdBYBn6VVQdR947vWneQBFzdhasyzMUKg==",
       "requires": {
-        "@vue/reactivity": "3.2.30",
-        "@vue/shared": "3.2.30"
+        "@vue/reactivity": "3.2.40",
+        "@vue/shared": "3.2.40"
       },
       "dependencies": {
         "@vue/shared": {
-          "version": "3.2.30",
-          "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.30.tgz",
-          "integrity": "sha512-B3HouBtUxcfu2w2d+VhdLcVBXKYYhXiFMAfQ+hoe8NUhKkPRkWDIqhpuehCZxVQ3S2dN1P1WfKGlxGC+pfmxGg=="
+          "version": "3.2.40",
+          "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.40.tgz",
+          "integrity": "sha512-0PLQ6RUtZM0vO3teRfzGi4ltLUO5aO+kLgwh4Um3THSR03rpQWLTuRCkuO5A41ITzwdWeKdPHtSARuPkoo5pCQ=="
         }
       }
     },
     "@vue/runtime-dom": {
-      "version": "3.2.30",
-      "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.30.tgz",
-      "integrity": "sha512-a3+jrncDvEFQmB+v9k0VyT4/Y3XO6OAueCroXXY4yLyr6PJeyxljweV5TzvW0rvVzH9sZO0QAvG76Lo+6C92Qw==",
+      "version": "3.2.40",
+      "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.40.tgz",
+      "integrity": "sha512-AO2HMQ+0s2+MCec8hXAhxMgWhFhOPJ/CyRXnmTJ6XIOnJFLrH5Iq3TNwvVcODGR295jy77I6dWPj+wvFoSYaww==",
       "requires": {
-        "@vue/runtime-core": "3.2.30",
-        "@vue/shared": "3.2.30",
+        "@vue/runtime-core": "3.2.40",
+        "@vue/shared": "3.2.40",
         "csstype": "^2.6.8"
       },
       "dependencies": {
         "@vue/shared": {
-          "version": "3.2.30",
-          "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.30.tgz",
-          "integrity": "sha512-B3HouBtUxcfu2w2d+VhdLcVBXKYYhXiFMAfQ+hoe8NUhKkPRkWDIqhpuehCZxVQ3S2dN1P1WfKGlxGC+pfmxGg=="
+          "version": "3.2.40",
+          "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.40.tgz",
+          "integrity": "sha512-0PLQ6RUtZM0vO3teRfzGi4ltLUO5aO+kLgwh4Um3THSR03rpQWLTuRCkuO5A41ITzwdWeKdPHtSARuPkoo5pCQ=="
         }
       }
     },
     "@vue/server-renderer": {
-      "version": "3.2.30",
-      "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.2.30.tgz",
-      "integrity": "sha512-pzb8J/w+JdZVOtuKFlirGqrs4GP60FXGDJySw3WV2pCetuFstaacDrnymEeSo3ohAD+Qjv7zAG+Y7OvkdxQxmQ==",
+      "version": "3.2.40",
+      "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.2.40.tgz",
+      "integrity": "sha512-gtUcpRwrXOJPJ4qyBpU3EyxQa4EkV8I4f8VrDePcGCPe4O/hd0BPS7v9OgjIQob6Ap8VDz9G+mGTKazE45/95w==",
       "requires": {
-        "@vue/compiler-ssr": "3.2.30",
-        "@vue/shared": "3.2.30"
+        "@vue/compiler-ssr": "3.2.40",
+        "@vue/shared": "3.2.40"
       },
       "dependencies": {
         "@babel/parser": {
-          "version": "7.21.2",
-          "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.2.tgz",
-          "integrity": "sha512-URpaIJQwEkEC2T9Kn+Ai6Xe/02iNaVCuT/PtoRz3GPVJVDpPd7mLo+VddTbhCRU9TXqW5mSrQfXZyi8kDKOVpQ=="
+          "version": "7.21.3",
+          "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.3.tgz",
+          "integrity": "sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ=="
         },
         "@vue/compiler-core": {
-          "version": "3.2.30",
-          "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.30.tgz",
-          "integrity": "sha512-64fq1KfcR+k3Vlw+IsBM2VhV5B+2IP3YxvKU8LWCDLrkmlXtbf2eMK6+0IwX5KP41D0f1gzryIiXR7P8cB9O5Q==",
+          "version": "3.2.40",
+          "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.40.tgz",
+          "integrity": "sha512-2Dc3Stk0J/VyQ4OUr2yEC53kU28614lZS+bnrCbFSAIftBJ40g/2yQzf4mPBiFuqguMB7hyHaujdgZAQ67kZYA==",
           "requires": {
             "@babel/parser": "^7.16.4",
-            "@vue/shared": "3.2.30",
+            "@vue/shared": "3.2.40",
             "estree-walker": "^2.0.2",
             "source-map": "^0.6.1"
           }
         },
         "@vue/compiler-dom": {
-          "version": "3.2.30",
-          "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.30.tgz",
-          "integrity": "sha512-t7arHz2SXLCXlF2fdGDFVbhENbGMez254Z5edUqb//6WXJU1lC7GvSkUE7i5x8WSjgfqt60i0V8zdmk16rvLdw==",
+          "version": "3.2.40",
+          "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.40.tgz",
+          "integrity": "sha512-OZCNyYVC2LQJy4H7h0o28rtk+4v+HMQygRTpmibGoG9wZyomQiS5otU7qo3Wlq5UfHDw2RFwxb9BJgKjVpjrQw==",
           "requires": {
-            "@vue/compiler-core": "3.2.30",
-            "@vue/shared": "3.2.30"
+            "@vue/compiler-core": "3.2.40",
+            "@vue/shared": "3.2.40"
           }
         },
         "@vue/compiler-ssr": {
-          "version": "3.2.30",
-          "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.30.tgz",
-          "integrity": "sha512-OUh3MwAu/PsD7VN3UOdBbTkltkrUCNouSht47+CMRzpUR5+ta7+xyMAVHeq8wg4YZenWaJimbR5TL35Ka4Vk6g==",
+          "version": "3.2.40",
+          "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.40.tgz",
+          "integrity": "sha512-80cQcgasKjrPPuKcxwuCx7feq+wC6oFl5YaKSee9pV3DNq+6fmCVwEEC3vvkf/E2aI76rIJSOYHsWSEIxK74oQ==",
           "requires": {
-            "@vue/compiler-dom": "3.2.30",
-            "@vue/shared": "3.2.30"
+            "@vue/compiler-dom": "3.2.40",
+            "@vue/shared": "3.2.40"
           }
         },
         "@vue/shared": {
-          "version": "3.2.30",
-          "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.30.tgz",
-          "integrity": "sha512-B3HouBtUxcfu2w2d+VhdLcVBXKYYhXiFMAfQ+hoe8NUhKkPRkWDIqhpuehCZxVQ3S2dN1P1WfKGlxGC+pfmxGg=="
+          "version": "3.2.40",
+          "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.40.tgz",
+          "integrity": "sha512-0PLQ6RUtZM0vO3teRfzGi4ltLUO5aO+kLgwh4Um3THSR03rpQWLTuRCkuO5A41ITzwdWeKdPHtSARuPkoo5pCQ=="
         }
       }
     },
@@ -822,53 +822,53 @@
       }
     },
     "vue": {
-      "version": "3.2.30",
-      "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.30.tgz",
-      "integrity": "sha512-ZmTFWVJUX2XADkuOB8GcLTuxnBLogjJBTNVrM7WsTnjqRQ+VR8bLNrvNsbn8vj/LaP5+0WFAPrpngOYE2x+e+Q==",
-      "requires": {
-        "@vue/compiler-dom": "3.2.30",
-        "@vue/compiler-sfc": "3.2.30",
-        "@vue/runtime-dom": "3.2.30",
-        "@vue/server-renderer": "3.2.30",
-        "@vue/shared": "3.2.30"
+      "version": "3.2.40",
+      "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.40.tgz",
+      "integrity": "sha512-1mGHulzUbl2Nk3pfvI5aXYYyJUs1nm4kyvuz38u4xlQkLUn1i2R7nDbI4TufECmY8v1qNBHYy62bCaM+3cHP2A==",
+      "requires": {
+        "@vue/compiler-dom": "3.2.40",
+        "@vue/compiler-sfc": "3.2.40",
+        "@vue/runtime-dom": "3.2.40",
+        "@vue/server-renderer": "3.2.40",
+        "@vue/shared": "3.2.40"
       },
       "dependencies": {
         "@babel/parser": {
-          "version": "7.21.2",
-          "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.2.tgz",
-          "integrity": "sha512-URpaIJQwEkEC2T9Kn+Ai6Xe/02iNaVCuT/PtoRz3GPVJVDpPd7mLo+VddTbhCRU9TXqW5mSrQfXZyi8kDKOVpQ=="
+          "version": "7.21.3",
+          "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.3.tgz",
+          "integrity": "sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ=="
         },
         "@vue/compiler-core": {
-          "version": "3.2.30",
-          "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.30.tgz",
-          "integrity": "sha512-64fq1KfcR+k3Vlw+IsBM2VhV5B+2IP3YxvKU8LWCDLrkmlXtbf2eMK6+0IwX5KP41D0f1gzryIiXR7P8cB9O5Q==",
+          "version": "3.2.40",
+          "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.40.tgz",
+          "integrity": "sha512-2Dc3Stk0J/VyQ4OUr2yEC53kU28614lZS+bnrCbFSAIftBJ40g/2yQzf4mPBiFuqguMB7hyHaujdgZAQ67kZYA==",
           "requires": {
             "@babel/parser": "^7.16.4",
-            "@vue/shared": "3.2.30",
+            "@vue/shared": "3.2.40",
             "estree-walker": "^2.0.2",
             "source-map": "^0.6.1"
           }
         },
         "@vue/compiler-dom": {
-          "version": "3.2.30",
-          "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.30.tgz",
-          "integrity": "sha512-t7arHz2SXLCXlF2fdGDFVbhENbGMez254Z5edUqb//6WXJU1lC7GvSkUE7i5x8WSjgfqt60i0V8zdmk16rvLdw==",
+          "version": "3.2.40",
+          "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.40.tgz",
+          "integrity": "sha512-OZCNyYVC2LQJy4H7h0o28rtk+4v+HMQygRTpmibGoG9wZyomQiS5otU7qo3Wlq5UfHDw2RFwxb9BJgKjVpjrQw==",
           "requires": {
-            "@vue/compiler-core": "3.2.30",
-            "@vue/shared": "3.2.30"
+            "@vue/compiler-core": "3.2.40",
+            "@vue/shared": "3.2.40"
           }
         },
         "@vue/compiler-sfc": {
-          "version": "3.2.30",
-          "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.30.tgz",
-          "integrity": "sha512-P/5YpILtcQY92z72gxhkyOUPHVskEzhSrvYi91Xcr+csOxaDaYU5OqOxCzZKcf3Og70Tat404vO1OHrwprN90A==",
+          "version": "3.2.40",
+          "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.40.tgz",
+          "integrity": "sha512-tzqwniIN1fu1PDHC3CpqY/dPCfN/RN1thpBC+g69kJcrl7mbGiHKNwbA6kJ3XKKy8R6JLKqcpVugqN4HkeBFFg==",
           "requires": {
             "@babel/parser": "^7.16.4",
-            "@vue/compiler-core": "3.2.30",
-            "@vue/compiler-dom": "3.2.30",
-            "@vue/compiler-ssr": "3.2.30",
-            "@vue/reactivity-transform": "3.2.30",
-            "@vue/shared": "3.2.30",
+            "@vue/compiler-core": "3.2.40",
+            "@vue/compiler-dom": "3.2.40",
+            "@vue/compiler-ssr": "3.2.40",
+            "@vue/reactivity-transform": "3.2.40",
+            "@vue/shared": "3.2.40",
             "estree-walker": "^2.0.2",
             "magic-string": "^0.25.7",
             "postcss": "^8.1.10",
@@ -876,18 +876,18 @@
           }
         },
         "@vue/compiler-ssr": {
-          "version": "3.2.30",
-          "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.30.tgz",
-          "integrity": "sha512-OUh3MwAu/PsD7VN3UOdBbTkltkrUCNouSht47+CMRzpUR5+ta7+xyMAVHeq8wg4YZenWaJimbR5TL35Ka4Vk6g==",
+          "version": "3.2.40",
+          "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.40.tgz",
+          "integrity": "sha512-80cQcgasKjrPPuKcxwuCx7feq+wC6oFl5YaKSee9pV3DNq+6fmCVwEEC3vvkf/E2aI76rIJSOYHsWSEIxK74oQ==",
           "requires": {
-            "@vue/compiler-dom": "3.2.30",
-            "@vue/shared": "3.2.30"
+            "@vue/compiler-dom": "3.2.40",
+            "@vue/shared": "3.2.40"
           }
         },
         "@vue/shared": {
-          "version": "3.2.30",
-          "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.30.tgz",
-          "integrity": "sha512-B3HouBtUxcfu2w2d+VhdLcVBXKYYhXiFMAfQ+hoe8NUhKkPRkWDIqhpuehCZxVQ3S2dN1P1WfKGlxGC+pfmxGg=="
+          "version": "3.2.40",
+          "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.40.tgz",
+          "integrity": "sha512-0PLQ6RUtZM0vO3teRfzGi4ltLUO5aO+kLgwh4Um3THSR03rpQWLTuRCkuO5A41ITzwdWeKdPHtSARuPkoo5pCQ=="
         }
       }
     },

+ 1 - 1
package.json

@@ -11,7 +11,7 @@
     "axios": "^1.3.4",
     "element-plus": "^2.2.32",
     "pinia": "^2.0.32",
-    "vue": "^3.2.30",
+    "vue": "^3.2.40",
     "vue-i18n": "^9.2.2",
     "vue-router": "^4.1.6"
   },

+ 5 - 5
public/test/menu.json

@@ -2,30 +2,30 @@
 	{
 		"menuId":"1",
 		"menuName":"首页",
-		"icon":"HomeFilled",
+		"menuIcon":"HomeFilled",
 		"menuLink":"desktop.vue"
 	},
 	{
 		"menuId":"2",
 		"menuName":"单井数据",
-		"icon":"Document",
+		"menuIcon":"Document",
 		"menuLink":"single/wellPatrol.vue"
 	},
 	{
 		"menuId":"3",
 		"menuName":"多井数据",
-		"icon":"DocumentCopy",
+		"menuIcon":"DocumentCopy",
 		"menuLink":"multi/multiPatrol.vue"
 	},
 	{
 		"menuId":"4",
 		"menuName":"井站管理",
-		"icon":"School"
+		"menuIcon":"School"
 	},
 	{
 		"menuId":"5",
 		"menuName":"系统管理",
-		"icon":"Tools",
+		"menuIcon":"Tools",
 		"subMenus":[
 			{
 				"menuId":"5-0",

+ 25 - 5
src/api/header.js

@@ -1,9 +1,29 @@
 import request from '../utils/request';
 
-export const fetchData = query => {
+export const fetchData = () => {
     return request({
-        url: './test/menu.json',
-        method: 'get',
-        params: query
+        url: '/auth/loadMyMenus',
+        method: 'post'
     });
-};
+};
+
+export const processMenus=(menus)=>{
+	let map={};
+	menus.forEach(menu=>{
+		map[menu.menuId]=menu
+	})
+	
+	let pMenu=null,pMenuList=[]
+	menus.forEach(menu=>{
+		pMenu=map[menu.fatherMenuId]
+		if(pMenu){
+			pMenu.subMenus=pMenu.subMenus||[]
+			pMenu.subMenus.push(menu)
+		}
+		else{
+			pMenuList.push(menu)
+		}
+	})
+	
+	return pMenuList
+}

+ 9 - 0
src/api/login.js

@@ -0,0 +1,9 @@
+import request from '../utils/request';
+
+export const checkLogin = loginForm => {
+    return request({
+        url: '/login/check',
+        method: 'post',
+        params: loginForm
+    });
+};

BIN
src/assets/img/bg_mh.jpg


+ 11 - 5
src/components/Header.vue

@@ -55,7 +55,7 @@
 	import { storeToRefs } from 'pinia'
 	import { useHomeStore } from "../store/home.js"
 	import { useRouter } from "vue-router"
-	import { fetchData } from "../api/header.js"
+	import { fetchData,processMenus } from "../api/header.js"
 	import navmenuItem from "./NavmenuItem.vue"
 	
 	const store=useHomeStore()
@@ -65,11 +65,17 @@
 	const menus = ref([])
 	
 	const getData = () => {
-	    fetchData({}).then((res) => {
-	        console.log(res)
-			menus.value=res
+	    fetchData().then( resp => {
+			console.log(resp)
+			if(resp.code===0){
+				menus.value=processMenus(resp.data||[])
+				store.currentMenu=menus.value[0]
+			}
+			else{
+				console.log(resp.msg)
+			}
+	        
 			
-			store.currentMenu=res[0]
 	    });
 	};
 	getData();

+ 4 - 4
src/components/NavmenuItem.vue

@@ -1,15 +1,15 @@
 <template>
 	<el-menu-item :index="item?item.menuId:''" v-if="!item || !item.subMenus || item.subMenus.length ===0" @click="(menucomp)=>{clickHandle(item)}">
-		<el-icon v-if="item.icon">
-			<component :is="item.icon"></component>
+		<el-icon v-if="item.menuIcon">
+			<component :is="item.menuIcon"></component>
 		</el-icon>
 		{{ item?.menuName }}
 	</el-menu-item>
 	
 	<el-sub-menu :index="item ? item.menuId : ''" v-else>
 		<template #title>
-			<el-icon v-if="item.icon">
-				<component :is="item.icon"></component>
+			<el-icon v-if="item.menuIcon">
+				<component :is="item.menuIcon"></component>
 			</el-icon>
 		    {{ item?.menuName }}
 		</template>

+ 39 - 28
src/pages/Login.vue

@@ -6,16 +6,16 @@
 		</div>
 	    <div class="ms-login">
 	        <div class="ms-title">智能油田生产决策平台</div>
-	        <el-form :model="param" :rules="rules" ref="login" label-width="0px" class="ms-content">
-	            <el-form-item prop="username">
-	                <el-input v-model="param.username" placeholder="用户名" input-style="height:40px">
+	        <el-form :model="loginForm" :rules="rules" ref="login" label-width="0px" class="ms-content">
+	            <el-form-item prop="loginId">
+	                <el-input v-model="loginForm.loginId" placeholder="用户名" input-style="height:40px" tabindex="1">
 	                    <template #prepend>
 	                       <el-button icon="User"></el-button>
 						</template>
 	                </el-input>
 	            </el-form-item>
-	            <el-form-item prop="password">
-	                <el-input type="password" placeholder="密码" v-model="param.password" input-style="height:40px"
+	            <el-form-item prop="pwd">
+	                <el-input type="password" placeholder="密码" v-model="loginForm.pwd" input-style="height:40px" tabindex="2"
 	                    @keyup.enter="submitForm()">
 	                    <template #prepend>
 	                        <el-button icon="Lock"></el-button>
@@ -23,7 +23,7 @@
 	                </el-input>
 	            </el-form-item>
 	            <div class="login-btn">
-	                <el-button type="primary" @click="submitForm()" size="default">登录</el-button>
+	                <el-button type="primary" @click="submitForm()" size="default" tabindex="3" :loading="isLoading">登录</el-button>
 	            </div>
 	            <p class="login-tips"></p>
 	        </el-form>
@@ -36,44 +36,55 @@ import { ref, reactive } from "vue";
 
 import { useRouter } from "vue-router";
 import { ElMessage } from "element-plus";
-
-
+import { checkLogin } from "../api/login.js"
+import app from "../utils/app.js"
+import md5 from '../utils/md5.js'
 
 		const router = useRouter();
-        const param = reactive({
-            username: "admin",
-            password: "123123",
+        const loginForm = reactive({
+            loginId: '',
+            pwd: '',
         });
 
         const rules = {
-            username: [
-                {
-                    required: true,
-                    message: "请输入用户名",
-                    trigger: "blur",
-                },
-            ],
-            password: [
-                { required: true, message: "请输入密码", trigger: "blur" },
-            ],
+            loginId: [{required: true, message: "请输入用户名",trigger: "blur"}],
+            pwd: [{ required: true, message: "请输入密码", trigger: "blur" }]
         };
 		
+		const isLoading=ref(false)
 		const login = ref(null);
 		const submitForm = () => {
 		    login.value.validate((valid) => {
-		        if (valid) {
-		            ElMessage.success("登录成功");
-		            localStorage.setItem("ms_username", param.username);
-		            router.push("/home");
+				if (valid) {
+					isLoading.value=true
+					let {loginId,pwd}=loginForm
+					pwd=md5(pwd)
+					//console.log(pwd+","+loginForm.pwd)
+					checkLogin({loginId,pwd}).then(resp=>{
+						console.log(resp)
+						isLoading.value=false
+						if(resp.code===0){
+							ElMessage.success("登录成功");
+							router.push("/home");
+							app.putSetting("token",resp.data.tokenId)
+						}
+						else{
+							ElMessage.error(resp.msg);
+						}
+						
+					}).catch(error=>{
+						isLoading.value=false
+						ElMessage.error(error);
+					})
+					
 		        } else {
-		            ElMessage.error("登录失败");
+		            ElMessage.error("验证未通过");
 		            return false;
 		        }
 		    });
 		};
 		
-		//const store = useStore();
-		//store.commit("clearTags");
+		
 </script>
 
 <style scoped>

+ 41 - 0
src/utils/app.js

@@ -0,0 +1,41 @@
+export default {
+	
+	getSetting:function(){
+		let settingstr=sessionStorage.getItem('$settings'); //不存在时是空串
+		//console.log(settingstr.length);
+		return settingstr?JSON.parse(settingstr):null;
+	},
+	setSetting:function(setting){
+		setting = setting || {};
+		sessionStorage.setItem('$settings', JSON.stringify(setting));
+	},
+	addSetting:function(setting){
+		let settingObj=this.getSetting()||{};
+		this.extend(settingObj,setting);
+		this.setSetting(settingObj);
+	},
+	putSetting:function(key,val){
+		let settingObj=this.getSetting()||{};
+		settingObj[key]=val;
+		this.setSetting(settingObj);
+	},
+	takeSetting:function(key){
+		let setting=this.getSetting()||{};
+		return setting[key];
+	},
+	clearSetting:function(){
+		uni.clear();
+	},
+	extend:function(srcObj,refObj){
+		for(let attr in refObj){
+			srcObj[attr]=refObj[attr];
+		}
+	}
+	
+	
+	
+	
+	
+	
+	
+}

+ 691 - 0
src/utils/md5.js

@@ -0,0 +1,691 @@
+/**
+ * [js-md5]{@link https://github.com/emn178/js-md5}
+ *
+ * @namespace md5
+ * @version 0.7.3
+ * @author Chen, Yi-Cyuan [emn178@gmail.com]
+ * @copyright Chen, Yi-Cyuan 2014-2017
+ * @license MIT
+ */
+export default (function () {
+  'use strict';
+
+  var ERROR = 'input is invalid type';
+  var WINDOW = typeof window === 'object';
+  var root = WINDOW ? window : {};
+  if (root.JS_MD5_NO_WINDOW) {
+    WINDOW = false;
+  }
+  var WEB_WORKER = !WINDOW && typeof self === 'object';
+  var NODE_JS = !root.JS_MD5_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;
+  if (NODE_JS) {
+    root = global;
+  } else if (WEB_WORKER) {
+    root = self;
+  }
+  var COMMON_JS = !root.JS_MD5_NO_COMMON_JS && typeof module === 'object' && module.exports;
+  var AMD = typeof define === 'function' && define.amd;
+  var ARRAY_BUFFER = !root.JS_MD5_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined';
+  var HEX_CHARS = '0123456789abcdef'.split('');
+  var EXTRA = [128, 32768, 8388608, -2147483648];
+  var SHIFT = [0, 8, 16, 24];
+  var OUTPUT_TYPES = ['hex', 'array', 'digest', 'buffer', 'arrayBuffer', 'base64'];
+  var BASE64_ENCODE_CHAR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
+
+  var blocks = [], buffer8;
+  if (ARRAY_BUFFER) {
+    var buffer = new ArrayBuffer(68);
+    buffer8 = new Uint8Array(buffer);
+    blocks = new Uint32Array(buffer);
+  }
+
+  if (root.JS_MD5_NO_NODE_JS || !Array.isArray) {
+    Array.isArray = function (obj) {
+      return Object.prototype.toString.call(obj) === '[object Array]';
+    };
+  }
+
+  if (ARRAY_BUFFER && (root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {
+    ArrayBuffer.isView = function (obj) {
+      return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer;
+    };
+  }
+
+  /**
+   * @method hex
+   * @memberof md5
+   * @description Output hash as hex string
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {String} Hex string
+   * @example
+   * md5.hex('The quick brown fox jumps over the lazy dog');
+   * // equal to
+   * md5('The quick brown fox jumps over the lazy dog');
+   */
+  /**
+   * @method digest
+   * @memberof md5
+   * @description Output hash as bytes array
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {Array} Bytes array
+   * @example
+   * md5.digest('The quick brown fox jumps over the lazy dog');
+   */
+  /**
+   * @method array
+   * @memberof md5
+   * @description Output hash as bytes array
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {Array} Bytes array
+   * @example
+   * md5.array('The quick brown fox jumps over the lazy dog');
+   */
+  /**
+   * @method arrayBuffer
+   * @memberof md5
+   * @description Output hash as ArrayBuffer
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {ArrayBuffer} ArrayBuffer
+   * @example
+   * md5.arrayBuffer('The quick brown fox jumps over the lazy dog');
+   */
+  /**
+   * @method buffer
+   * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.
+   * @memberof md5
+   * @description Output hash as ArrayBuffer
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {ArrayBuffer} ArrayBuffer
+   * @example
+   * md5.buffer('The quick brown fox jumps over the lazy dog');
+   */
+  /**
+   * @method base64
+   * @memberof md5
+   * @description Output hash as base64 string
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {String} base64 string
+   * @example
+   * md5.base64('The quick brown fox jumps over the lazy dog');
+   */
+  var createOutputMethod = function (outputType) {
+    return function (message) {
+      return new Md5(true).update(message)[outputType]();
+    };
+  };
+
+  /**
+   * @method create
+   * @memberof md5
+   * @description Create Md5 object
+   * @returns {Md5} Md5 object.
+   * @example
+   * var hash = md5.create();
+   */
+  /**
+   * @method update
+   * @memberof md5
+   * @description Create and update Md5 object
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {Md5} Md5 object.
+   * @example
+   * var hash = md5.update('The quick brown fox jumps over the lazy dog');
+   * // equal to
+   * var hash = md5.create();
+   * hash.update('The quick brown fox jumps over the lazy dog');
+   */
+  var createMethod = function () {
+    var method = createOutputMethod('hex');
+    if (NODE_JS) {
+      method = nodeWrap(method);
+    }
+    method.create = function () {
+      return new Md5();
+    };
+    method.update = function (message) {
+      return method.create().update(message);
+    };
+    for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
+      var type = OUTPUT_TYPES[i];
+      method[type] = createOutputMethod(type);
+    }
+    return method;
+  };
+
+  var nodeWrap = function (method) {
+    var crypto = eval("require('crypto')");
+    var Buffer = eval("require('buffer').Buffer");
+    var nodeMethod = function (message) {
+      if (typeof message === 'string') {
+        return crypto.createHash('md5').update(message, 'utf8').digest('hex');
+      } else {
+        if (message === null || message === undefined) {
+          throw ERROR;
+        } else if (message.constructor === ArrayBuffer) {
+          message = new Uint8Array(message);
+        }
+      }
+      if (Array.isArray(message) || ArrayBuffer.isView(message) ||
+        message.constructor === Buffer) {
+        return crypto.createHash('md5').update(new Buffer(message)).digest('hex');
+      } else {
+        return method(message);
+      }
+    };
+    return nodeMethod;
+  };
+
+
+
+  /**
+   * Md5 class
+   * @class Md5
+   * @description This is internal class.
+   * @see {@link md5.create}
+   */
+  function Md5(sharedMemory) {
+    if (sharedMemory) {
+      blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] =
+      blocks[4] = blocks[5] = blocks[6] = blocks[7] =
+      blocks[8] = blocks[9] = blocks[10] = blocks[11] =
+      blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
+      this.blocks = blocks;
+      this.buffer8 = buffer8;
+    } else {
+      if (ARRAY_BUFFER) {
+        var buffer = new ArrayBuffer(68);
+        this.buffer8 = new Uint8Array(buffer);
+        this.blocks = new Uint32Array(buffer);
+      } else {
+        this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+      }
+    }
+    this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = this.hBytes = 0;
+    this.finalized = this.hashed = false;
+    this.first = true;
+  }
+
+  /**
+   * @method update
+   * @memberof Md5
+   * @instance
+   * @description Update hash
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {Md5} Md5 object.
+   * @see {@link md5.update}
+   */
+  Md5.prototype.update = function (message) {
+    if (this.finalized) {
+      return;
+    }
+
+    var notString, type = typeof message;
+    if (type !== 'string') {
+      if (type === 'object') {
+        if (message === null) {
+          throw ERROR;
+        } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {
+          message = new Uint8Array(message);
+        } else if (!Array.isArray(message)) {
+          if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) {
+            throw ERROR;
+          }
+        }
+      } else {
+        throw ERROR;
+      }
+      notString = true;
+    }
+    var code, index = 0, i, length = message.length, blocks = this.blocks;
+    var buffer8 = this.buffer8;
+
+    while (index < length) {
+      if (this.hashed) {
+        this.hashed = false;
+        blocks[0] = blocks[16];
+        blocks[16] = blocks[1] = blocks[2] = blocks[3] =
+        blocks[4] = blocks[5] = blocks[6] = blocks[7] =
+        blocks[8] = blocks[9] = blocks[10] = blocks[11] =
+        blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
+      }
+
+      if (notString) {
+        if (ARRAY_BUFFER) {
+          for (i = this.start; index < length && i < 64; ++index) {
+            buffer8[i++] = message[index];
+          }
+        } else {
+          for (i = this.start; index < length && i < 64; ++index) {
+            blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];
+          }
+        }
+      } else {
+        if (ARRAY_BUFFER) {
+          for (i = this.start; index < length && i < 64; ++index) {
+            code = message.charCodeAt(index);
+            if (code < 0x80) {
+              buffer8[i++] = code;
+            } else if (code < 0x800) {
+              buffer8[i++] = 0xc0 | (code >> 6);
+              buffer8[i++] = 0x80 | (code & 0x3f);
+            } else if (code < 0xd800 || code >= 0xe000) {
+              buffer8[i++] = 0xe0 | (code >> 12);
+              buffer8[i++] = 0x80 | ((code >> 6) & 0x3f);
+              buffer8[i++] = 0x80 | (code & 0x3f);
+            } else {
+              code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
+              buffer8[i++] = 0xf0 | (code >> 18);
+              buffer8[i++] = 0x80 | ((code >> 12) & 0x3f);
+              buffer8[i++] = 0x80 | ((code >> 6) & 0x3f);
+              buffer8[i++] = 0x80 | (code & 0x3f);
+            }
+          }
+        } else {
+          for (i = this.start; index < length && i < 64; ++index) {
+            code = message.charCodeAt(index);
+            if (code < 0x80) {
+              blocks[i >> 2] |= code << SHIFT[i++ & 3];
+            } else if (code < 0x800) {
+              blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];
+              blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
+            } else if (code < 0xd800 || code >= 0xe000) {
+              blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];
+              blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
+              blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
+            } else {
+              code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
+              blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];
+              blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];
+              blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
+              blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
+            }
+          }
+        }
+      }
+      this.lastByteIndex = i;
+      this.bytes += i - this.start;
+      if (i >= 64) {
+        this.start = i - 64;
+        this.hash();
+        this.hashed = true;
+      } else {
+        this.start = i;
+      }
+    }
+    if (this.bytes > 4294967295) {
+      this.hBytes += this.bytes / 4294967296 << 0;
+      this.bytes = this.bytes % 4294967296;
+    }
+    return this;
+  };
+
+  Md5.prototype.finalize = function () {
+    if (this.finalized) {
+      return;
+    }
+    this.finalized = true;
+    var blocks = this.blocks, i = this.lastByteIndex;
+    blocks[i >> 2] |= EXTRA[i & 3];
+    if (i >= 56) {
+      if (!this.hashed) {
+        this.hash();
+      }
+      blocks[0] = blocks[16];
+      blocks[16] = blocks[1] = blocks[2] = blocks[3] =
+      blocks[4] = blocks[5] = blocks[6] = blocks[7] =
+      blocks[8] = blocks[9] = blocks[10] = blocks[11] =
+      blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
+    }
+    blocks[14] = this.bytes << 3;
+    blocks[15] = this.hBytes << 3 | this.bytes >>> 29;
+    this.hash();
+  };
+
+  Md5.prototype.hash = function () {
+    var a, b, c, d, bc, da, blocks = this.blocks;
+
+    if (this.first) {
+      a = blocks[0] - 680876937;
+      a = (a << 7 | a >>> 25) - 271733879 << 0;
+      d = (-1732584194 ^ a & 2004318071) + blocks[1] - 117830708;
+      d = (d << 12 | d >>> 20) + a << 0;
+      c = (-271733879 ^ (d & (a ^ -271733879))) + blocks[2] - 1126478375;
+      c = (c << 17 | c >>> 15) + d << 0;
+      b = (a ^ (c & (d ^ a))) + blocks[3] - 1316259209;
+      b = (b << 22 | b >>> 10) + c << 0;
+    } else {
+      a = this.h0;
+      b = this.h1;
+      c = this.h2;
+      d = this.h3;
+      a += (d ^ (b & (c ^ d))) + blocks[0] - 680876936;
+      a = (a << 7 | a >>> 25) + b << 0;
+      d += (c ^ (a & (b ^ c))) + blocks[1] - 389564586;
+      d = (d << 12 | d >>> 20) + a << 0;
+      c += (b ^ (d & (a ^ b))) + blocks[2] + 606105819;
+      c = (c << 17 | c >>> 15) + d << 0;
+      b += (a ^ (c & (d ^ a))) + blocks[3] - 1044525330;
+      b = (b << 22 | b >>> 10) + c << 0;
+    }
+
+    a += (d ^ (b & (c ^ d))) + blocks[4] - 176418897;
+    a = (a << 7 | a >>> 25) + b << 0;
+    d += (c ^ (a & (b ^ c))) + blocks[5] + 1200080426;
+    d = (d << 12 | d >>> 20) + a << 0;
+    c += (b ^ (d & (a ^ b))) + blocks[6] - 1473231341;
+    c = (c << 17 | c >>> 15) + d << 0;
+    b += (a ^ (c & (d ^ a))) + blocks[7] - 45705983;
+    b = (b << 22 | b >>> 10) + c << 0;
+    a += (d ^ (b & (c ^ d))) + blocks[8] + 1770035416;
+    a = (a << 7 | a >>> 25) + b << 0;
+    d += (c ^ (a & (b ^ c))) + blocks[9] - 1958414417;
+    d = (d << 12 | d >>> 20) + a << 0;
+    c += (b ^ (d & (a ^ b))) + blocks[10] - 42063;
+    c = (c << 17 | c >>> 15) + d << 0;
+    b += (a ^ (c & (d ^ a))) + blocks[11] - 1990404162;
+    b = (b << 22 | b >>> 10) + c << 0;
+    a += (d ^ (b & (c ^ d))) + blocks[12] + 1804603682;
+    a = (a << 7 | a >>> 25) + b << 0;
+    d += (c ^ (a & (b ^ c))) + blocks[13] - 40341101;
+    d = (d << 12 | d >>> 20) + a << 0;
+    c += (b ^ (d & (a ^ b))) + blocks[14] - 1502002290;
+    c = (c << 17 | c >>> 15) + d << 0;
+    b += (a ^ (c & (d ^ a))) + blocks[15] + 1236535329;
+    b = (b << 22 | b >>> 10) + c << 0;
+    a += (c ^ (d & (b ^ c))) + blocks[1] - 165796510;
+    a = (a << 5 | a >>> 27) + b << 0;
+    d += (b ^ (c & (a ^ b))) + blocks[6] - 1069501632;
+    d = (d << 9 | d >>> 23) + a << 0;
+    c += (a ^ (b & (d ^ a))) + blocks[11] + 643717713;
+    c = (c << 14 | c >>> 18) + d << 0;
+    b += (d ^ (a & (c ^ d))) + blocks[0] - 373897302;
+    b = (b << 20 | b >>> 12) + c << 0;
+    a += (c ^ (d & (b ^ c))) + blocks[5] - 701558691;
+    a = (a << 5 | a >>> 27) + b << 0;
+    d += (b ^ (c & (a ^ b))) + blocks[10] + 38016083;
+    d = (d << 9 | d >>> 23) + a << 0;
+    c += (a ^ (b & (d ^ a))) + blocks[15] - 660478335;
+    c = (c << 14 | c >>> 18) + d << 0;
+    b += (d ^ (a & (c ^ d))) + blocks[4] - 405537848;
+    b = (b << 20 | b >>> 12) + c << 0;
+    a += (c ^ (d & (b ^ c))) + blocks[9] + 568446438;
+    a = (a << 5 | a >>> 27) + b << 0;
+    d += (b ^ (c & (a ^ b))) + blocks[14] - 1019803690;
+    d = (d << 9 | d >>> 23) + a << 0;
+    c += (a ^ (b & (d ^ a))) + blocks[3] - 187363961;
+    c = (c << 14 | c >>> 18) + d << 0;
+    b += (d ^ (a & (c ^ d))) + blocks[8] + 1163531501;
+    b = (b << 20 | b >>> 12) + c << 0;
+    a += (c ^ (d & (b ^ c))) + blocks[13] - 1444681467;
+    a = (a << 5 | a >>> 27) + b << 0;
+    d += (b ^ (c & (a ^ b))) + blocks[2] - 51403784;
+    d = (d << 9 | d >>> 23) + a << 0;
+    c += (a ^ (b & (d ^ a))) + blocks[7] + 1735328473;
+    c = (c << 14 | c >>> 18) + d << 0;
+    b += (d ^ (a & (c ^ d))) + blocks[12] - 1926607734;
+    b = (b << 20 | b >>> 12) + c << 0;
+    bc = b ^ c;
+    a += (bc ^ d) + blocks[5] - 378558;
+    a = (a << 4 | a >>> 28) + b << 0;
+    d += (bc ^ a) + blocks[8] - 2022574463;
+    d = (d << 11 | d >>> 21) + a << 0;
+    da = d ^ a;
+    c += (da ^ b) + blocks[11] + 1839030562;
+    c = (c << 16 | c >>> 16) + d << 0;
+    b += (da ^ c) + blocks[14] - 35309556;
+    b = (b << 23 | b >>> 9) + c << 0;
+    bc = b ^ c;
+    a += (bc ^ d) + blocks[1] - 1530992060;
+    a = (a << 4 | a >>> 28) + b << 0;
+    d += (bc ^ a) + blocks[4] + 1272893353;
+    d = (d << 11 | d >>> 21) + a << 0;
+    da = d ^ a;
+    c += (da ^ b) + blocks[7] - 155497632;
+    c = (c << 16 | c >>> 16) + d << 0;
+    b += (da ^ c) + blocks[10] - 1094730640;
+    b = (b << 23 | b >>> 9) + c << 0;
+    bc = b ^ c;
+    a += (bc ^ d) + blocks[13] + 681279174;
+    a = (a << 4 | a >>> 28) + b << 0;
+    d += (bc ^ a) + blocks[0] - 358537222;
+    d = (d << 11 | d >>> 21) + a << 0;
+    da = d ^ a;
+    c += (da ^ b) + blocks[3] - 722521979;
+    c = (c << 16 | c >>> 16) + d << 0;
+    b += (da ^ c) + blocks[6] + 76029189;
+    b = (b << 23 | b >>> 9) + c << 0;
+    bc = b ^ c;
+    a += (bc ^ d) + blocks[9] - 640364487;
+    a = (a << 4 | a >>> 28) + b << 0;
+    d += (bc ^ a) + blocks[12] - 421815835;
+    d = (d << 11 | d >>> 21) + a << 0;
+    da = d ^ a;
+    c += (da ^ b) + blocks[15] + 530742520;
+    c = (c << 16 | c >>> 16) + d << 0;
+    b += (da ^ c) + blocks[2] - 995338651;
+    b = (b << 23 | b >>> 9) + c << 0;
+    a += (c ^ (b | ~d)) + blocks[0] - 198630844;
+    a = (a << 6 | a >>> 26) + b << 0;
+    d += (b ^ (a | ~c)) + blocks[7] + 1126891415;
+    d = (d << 10 | d >>> 22) + a << 0;
+    c += (a ^ (d | ~b)) + blocks[14] - 1416354905;
+    c = (c << 15 | c >>> 17) + d << 0;
+    b += (d ^ (c | ~a)) + blocks[5] - 57434055;
+    b = (b << 21 | b >>> 11) + c << 0;
+    a += (c ^ (b | ~d)) + blocks[12] + 1700485571;
+    a = (a << 6 | a >>> 26) + b << 0;
+    d += (b ^ (a | ~c)) + blocks[3] - 1894986606;
+    d = (d << 10 | d >>> 22) + a << 0;
+    c += (a ^ (d | ~b)) + blocks[10] - 1051523;
+    c = (c << 15 | c >>> 17) + d << 0;
+    b += (d ^ (c | ~a)) + blocks[1] - 2054922799;
+    b = (b << 21 | b >>> 11) + c << 0;
+    a += (c ^ (b | ~d)) + blocks[8] + 1873313359;
+    a = (a << 6 | a >>> 26) + b << 0;
+    d += (b ^ (a | ~c)) + blocks[15] - 30611744;
+    d = (d << 10 | d >>> 22) + a << 0;
+    c += (a ^ (d | ~b)) + blocks[6] - 1560198380;
+    c = (c << 15 | c >>> 17) + d << 0;
+    b += (d ^ (c | ~a)) + blocks[13] + 1309151649;
+    b = (b << 21 | b >>> 11) + c << 0;
+    a += (c ^ (b | ~d)) + blocks[4] - 145523070;
+    a = (a << 6 | a >>> 26) + b << 0;
+    d += (b ^ (a | ~c)) + blocks[11] - 1120210379;
+    d = (d << 10 | d >>> 22) + a << 0;
+    c += (a ^ (d | ~b)) + blocks[2] + 718787259;
+    c = (c << 15 | c >>> 17) + d << 0;
+    b += (d ^ (c | ~a)) + blocks[9] - 343485551;
+    b = (b << 21 | b >>> 11) + c << 0;
+
+    if (this.first) {
+      this.h0 = a + 1732584193 << 0;
+      this.h1 = b - 271733879 << 0;
+      this.h2 = c - 1732584194 << 0;
+      this.h3 = d + 271733878 << 0;
+      this.first = false;
+    } else {
+      this.h0 = this.h0 + a << 0;
+      this.h1 = this.h1 + b << 0;
+      this.h2 = this.h2 + c << 0;
+      this.h3 = this.h3 + d << 0;
+    }
+  };
+
+  /**
+   * @method hex
+   * @memberof Md5
+   * @instance
+   * @description Output hash as hex string
+   * @returns {String} Hex string
+   * @see {@link md5.hex}
+   * @example
+   * hash.hex();
+   */
+  Md5.prototype.hex = function () {
+    this.finalize();
+
+    var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3;
+
+    return HEX_CHARS[(h0 >> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] +
+      HEX_CHARS[(h0 >> 12) & 0x0F] + HEX_CHARS[(h0 >> 8) & 0x0F] +
+      HEX_CHARS[(h0 >> 20) & 0x0F] + HEX_CHARS[(h0 >> 16) & 0x0F] +
+      HEX_CHARS[(h0 >> 28) & 0x0F] + HEX_CHARS[(h0 >> 24) & 0x0F] +
+      HEX_CHARS[(h1 >> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] +
+      HEX_CHARS[(h1 >> 12) & 0x0F] + HEX_CHARS[(h1 >> 8) & 0x0F] +
+      HEX_CHARS[(h1 >> 20) & 0x0F] + HEX_CHARS[(h1 >> 16) & 0x0F] +
+      HEX_CHARS[(h1 >> 28) & 0x0F] + HEX_CHARS[(h1 >> 24) & 0x0F] +
+      HEX_CHARS[(h2 >> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] +
+      HEX_CHARS[(h2 >> 12) & 0x0F] + HEX_CHARS[(h2 >> 8) & 0x0F] +
+      HEX_CHARS[(h2 >> 20) & 0x0F] + HEX_CHARS[(h2 >> 16) & 0x0F] +
+      HEX_CHARS[(h2 >> 28) & 0x0F] + HEX_CHARS[(h2 >> 24) & 0x0F] +
+      HEX_CHARS[(h3 >> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] +
+      HEX_CHARS[(h3 >> 12) & 0x0F] + HEX_CHARS[(h3 >> 8) & 0x0F] +
+      HEX_CHARS[(h3 >> 20) & 0x0F] + HEX_CHARS[(h3 >> 16) & 0x0F] +
+      HEX_CHARS[(h3 >> 28) & 0x0F] + HEX_CHARS[(h3 >> 24) & 0x0F];
+  };
+
+  /**
+   * @method toString
+   * @memberof Md5
+   * @instance
+   * @description Output hash as hex string
+   * @returns {String} Hex string
+   * @see {@link md5.hex}
+   * @example
+   * hash.toString();
+   */
+  Md5.prototype.toString = Md5.prototype.hex;
+
+  /**
+   * @method digest
+   * @memberof Md5
+   * @instance
+   * @description Output hash as bytes array
+   * @returns {Array} Bytes array
+   * @see {@link md5.digest}
+   * @example
+   * hash.digest();
+   */
+  Md5.prototype.digest = function () {
+    this.finalize();
+
+    var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3;
+    return [
+      h0 & 0xFF, (h0 >> 8) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 24) & 0xFF,
+      h1 & 0xFF, (h1 >> 8) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 24) & 0xFF,
+      h2 & 0xFF, (h2 >> 8) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 24) & 0xFF,
+      h3 & 0xFF, (h3 >> 8) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 24) & 0xFF
+    ];
+  };
+
+  /**
+   * @method array
+   * @memberof Md5
+   * @instance
+   * @description Output hash as bytes array
+   * @returns {Array} Bytes array
+   * @see {@link md5.array}
+   * @example
+   * hash.array();
+   */
+  Md5.prototype.array = Md5.prototype.digest;
+
+  /**
+   * @method arrayBuffer
+   * @memberof Md5
+   * @instance
+   * @description Output hash as ArrayBuffer
+   * @returns {ArrayBuffer} ArrayBuffer
+   * @see {@link md5.arrayBuffer}
+   * @example
+   * hash.arrayBuffer();
+   */
+  Md5.prototype.arrayBuffer = function () {
+    this.finalize();
+
+    var buffer = new ArrayBuffer(16);
+    var blocks = new Uint32Array(buffer);
+    blocks[0] = this.h0;
+    blocks[1] = this.h1;
+    blocks[2] = this.h2;
+    blocks[3] = this.h3;
+    return buffer;
+  };
+
+  /**
+   * @method buffer
+   * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.
+   * @memberof Md5
+   * @instance
+   * @description Output hash as ArrayBuffer
+   * @returns {ArrayBuffer} ArrayBuffer
+   * @see {@link md5.buffer}
+   * @example
+   * hash.buffer();
+   */
+  Md5.prototype.buffer = Md5.prototype.arrayBuffer;
+
+  /**
+   * @method base64
+   * @memberof Md5
+   * @instance
+   * @description Output hash as base64 string
+   * @returns {String} base64 string
+   * @see {@link md5.base64}
+   * @example
+   * hash.base64();
+   */
+  Md5.prototype.base64 = function () {
+    var v1, v2, v3, base64Str = '', bytes = this.array();
+    for (var i = 0; i < 15;) {
+      v1 = bytes[i++];
+      v2 = bytes[i++];
+      v3 = bytes[i++];
+      base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] +
+        BASE64_ENCODE_CHAR[(v1 << 4 | v2 >>> 4) & 63] +
+        BASE64_ENCODE_CHAR[(v2 << 2 | v3 >>> 6) & 63] +
+        BASE64_ENCODE_CHAR[v3 & 63];
+    }
+    v1 = bytes[i];
+    base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] +
+      BASE64_ENCODE_CHAR[(v1 << 4) & 63] +
+      '==';
+    return base64Str;
+  };
+
+  var exports = createMethod();
+
+  /*
+  if (COMMON_JS) {
+    module.exports = exports;
+  } else {
+    /**
+     * @method md5
+     * @description Md5 hash function, export to global in browsers.
+     * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+     * @returns {String} md5 hashes
+     * @example
+     * md5(''); // d41d8cd98f00b204e9800998ecf8427e
+     * md5('The quick brown fox jumps over the lazy dog'); // 9e107d9d372bb6826bd81d3542a419d6
+     * md5('The quick brown fox jumps over the lazy dog.'); // e4d909c290d0fb1ca068ffaddf22cbd0
+     *
+     * // It also supports UTF-8 encoding
+     * md5('中文'); // a7bac2239fcdcb3a067903d8077c4a07
+     *
+     * // It also supports byte `Array`, `Uint8Array`, `ArrayBuffer`
+     * md5([]); // d41d8cd98f00b204e9800998ecf8427e
+     * md5(new Uint8Array([])); // d41d8cd98f00b204e9800998ecf8427e
+     */
+    /*
+	root.md5 = exports;
+    if (AMD) {
+      define(function () {
+        return exports;
+      });
+    }*/
+	
+ /* }*/
+  
+   return exports;
+  
+})();

+ 6 - 3
src/utils/request.js

@@ -1,14 +1,17 @@
 import axios from 'axios';
+import app from './app.js'
 
 const service = axios.create({
     // process.env.NODE_ENV === 'development' 来判断是否开发环境
     // easy-mock服务挂了,暂时不使用了
     // baseURL: 'https://www.easy-mock.com/mock/592501a391470c0ac1fab128',
+	baseURL:'http://192.168.77.199:8080/zl',
     timeout: 5000
 });
 
 service.interceptors.request.use(
     config => {
+		config.headers.token=app.takeSetting("token")
         return config;
     },
     error => {
@@ -22,12 +25,12 @@ service.interceptors.response.use(
         if (response.status === 200) {
             return response.data;
         } else {
-            Promise.reject();
+            Promise.reject('远程服务出错');
         }
     },
     error => {
-        console.log(error);
-        return Promise.reject();
+        //console.log(error);
+        return Promise.reject('请求出现网络问题');
     }
 );
 

+ 15 - 0
src/utils/utils.js

@@ -0,0 +1,15 @@
+export default {
+	getNow(fmt){
+		let now=new Date();
+		let y=now.getFullYear(),m=now.getMonth()+1,d=now.getDate(),h=now.getHours(),mi=now.getMinutes(),s=now.getSeconds();
+		m=m>9?m.toString():('0'+m);
+		d=d>9?d.toString():('0'+d);
+		h=h>9?h.toString():('0'+h);
+		mi=mi>9?mi.toString():('0'+mi);
+		s=s>9?s.toString():('0'+s);
+		if(fmt=='mm月dd日'){
+			return `${m}月${d}日`;
+		}
+		return `${y}-${m}-${d} ${h}:${mi}:${s}`;
+	}
+}