Browse Source

菜单接口新增

yangxiao 3 years ago
parent
commit
300ff0f68d
7 changed files with 132 additions and 117 deletions
  1. 3 1
      .env.development
  2. 3 1
      .env.production
  3. 3 1
      .env.test
  4. 107 109
      package-lock.json
  5. 1 1
      package.json
  6. 1 2
      src/api/axios.js
  7. 14 2
      src/components/common/menu.vue

+ 3 - 1
.env.development

@@ -1,2 +1,4 @@
 // 开发服务
-VUE_APP_API_URL=http://10.155.32.4:8082/
+VUE_APP_API_URL=http://10.155.32.4:8082/
+// 本地联调 - 石林
+VUE_APP_LOCALTEST_URL=http://192.168.10.23:8082/

+ 3 - 1
.env.production

@@ -1,2 +1,4 @@
 // 生产服务
-VUE_APP_API_URL=http://10.155.32.4:8082/
+VUE_APP_API_URL=http://10.155.32.4:8082/
+// 本地联调 - 石林
+VUE_APP_LOCALTEST_URL=http://192.168.10.23:8082/

+ 3 - 1
.env.test

@@ -1,2 +1,4 @@
 // 测试服务
-VUE_APP_API_URL=http://test:8082/
+VUE_APP_API_URL=http://test:8082/
+// 本地联调 - 石林
+VUE_APP_LOCALTEST_URL=http://192.168.10.23:8082/

+ 107 - 109
package-lock.json

@@ -1710,6 +1710,16 @@
           "integrity": "sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo=",
           "dev": true
         },
+        "ansi-styles": {
+          "version": "4.3.0",
+          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "color-convert": "^2.0.1"
+          }
+        },
         "cacache": {
           "version": "13.0.1",
           "resolved": "https://registry.npm.taobao.org/cacache/download/cacache-13.0.1.tgz?cache=0&sync_timestamp=1616431251047&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcacache%2Fdownload%2Fcacache-13.0.1.tgz",
@@ -1736,6 +1746,53 @@
             "unique-filename": "^1.1.1"
           }
         },
+        "chalk": {
+          "version": "4.1.1",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
+          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "ansi-styles": "^4.1.0",
+            "supports-color": "^7.1.0"
+          }
+        },
+        "color-convert": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "color-name": "~1.1.4"
+          }
+        },
+        "color-name": {
+          "version": "1.1.4",
+          "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+          "dev": true,
+          "optional": true
+        },
+        "has-flag": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+          "dev": true,
+          "optional": true
+        },
+        "loader-utils": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
+          "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "big.js": "^5.2.2",
+            "emojis-list": "^3.0.0",
+            "json5": "^2.1.2"
+          }
+        },
         "source-map": {
           "version": "0.6.1",
           "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz",
@@ -1752,6 +1809,16 @@
             "minipass": "^3.1.1"
           }
         },
+        "supports-color": {
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "has-flag": "^4.0.0"
+          }
+        },
         "terser-webpack-plugin": {
           "version": "2.3.8",
           "resolved": "https://registry.npm.taobao.org/terser-webpack-plugin/download/terser-webpack-plugin-2.3.8.tgz",
@@ -1768,6 +1835,18 @@
             "terser": "^4.6.12",
             "webpack-sources": "^1.4.3"
           }
+        },
+        "vue-loader-v16": {
+          "version": "npm:vue-loader@16.2.0",
+          "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.2.0.tgz",
+          "integrity": "sha512-TitGhqSQ61RJljMmhIGvfWzJ2zk9m1Qug049Ugml6QP3t0e95o0XJjk29roNEiPKJQBEi8Ord5hFuSuELzSp8Q==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "chalk": "^4.1.0",
+            "hash-sum": "^2.0.0",
+            "loader-utils": "^2.0.0"
+          }
         }
       }
     },
@@ -2067,7 +2146,7 @@
     },
     "adler-32": {
       "version": "1.2.0",
-      "resolved": "https://registry.nlark.com/adler-32/download/adler-32-1.2.0.tgz",
+      "resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.2.0.tgz",
       "integrity": "sha1-aj5r8KY5ALoVZSgIyxXGgT0aXyU=",
       "requires": {
         "exit-on-epipe": "~1.0.1",
@@ -3556,8 +3635,8 @@
     },
     "cfb": {
       "version": "1.2.0",
-      "resolved": "https://registry.npm.taobao.org/cfb/download/cfb-1.2.0.tgz",
-      "integrity": "sha1-ak0IcrUl7WA0nh71H7Swv3Psqag=",
+      "resolved": "https://registry.npmjs.org/cfb/-/cfb-1.2.0.tgz",
+      "integrity": "sha512-sXMvHsKCICVR3Naq+J556K+ExBo9n50iKl6LGarlnvuA2035uMlGA/qVrc0wQtow5P1vJEw9UyrKLCbtIKz+TQ==",
       "requires": {
         "adler-32": "~1.2.0",
         "crc-32": "~1.2.0",
@@ -3906,7 +3985,7 @@
     },
     "codepage": {
       "version": "1.14.0",
-      "resolved": "https://registry.npm.taobao.org/codepage/download/codepage-1.14.0.tgz",
+      "resolved": "https://registry.npmjs.org/codepage/-/codepage-1.14.0.tgz",
       "integrity": "sha1-jL4lSBMjVZ19MHVxsP/5HnodL5k=",
       "requires": {
         "commander": "~2.14.1",
@@ -3915,8 +3994,8 @@
       "dependencies": {
         "commander": {
           "version": "2.14.1",
-          "resolved": "https://registry.nlark.com/commander/download/commander-2.14.1.tgz?cache=0&sync_timestamp=1621726670324&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcommander%2Fdownload%2Fcommander-2.14.1.tgz",
-          "integrity": "sha1-IjUSPjevjKPGXfRbAm29NXsBuao="
+          "resolved": "https://registry.npmjs.org/commander/-/commander-2.14.1.tgz",
+          "integrity": "sha512-+YR16o3rK53SmWHU3rEM3tPAh2rwb1yPcQX5irVn7mb0gXbwuCCrnkbV5+PBfETdfg1vui07nM6PCG1zndcjQw=="
         }
       }
     },
@@ -4374,8 +4453,8 @@
     },
     "crc-32": {
       "version": "1.2.0",
-      "resolved": "https://registry.npm.taobao.org/crc-32/download/crc-32-1.2.0.tgz",
-      "integrity": "sha1-yy224puIUI4y2d0OwWk+e0Ghggg=",
+      "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.0.tgz",
+      "integrity": "sha512-1uBwHxF+Y/4yF5G48fwnKq6QsIXheor3ZLPT80yGBV1oEUwpPojlEhQbWKVw1VwcTQyMGHK1/XMmTjmlsmTTGA==",
       "requires": {
         "exit-on-epipe": "~1.0.1",
         "printj": "~1.1.0"
@@ -5856,8 +5935,8 @@
     },
     "exit-on-epipe": {
       "version": "1.0.1",
-      "resolved": "https://registry.npm.taobao.org/exit-on-epipe/download/exit-on-epipe-1.0.1.tgz",
-      "integrity": "sha1-C92S6H1ShdJn2qgXHQ6wYVlolpI="
+      "resolved": "https://registry.npmjs.org/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz",
+      "integrity": "sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw=="
     },
     "expand-brackets": {
       "version": "2.1.4",
@@ -6283,8 +6362,8 @@
     },
     "file-saver": {
       "version": "2.0.5",
-      "resolved": "https://registry.npm.taobao.org/file-saver/download/file-saver-2.0.5.tgz?cache=0&sync_timestamp=1605790980036&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffile-saver%2Fdownload%2Ffile-saver-2.0.5.tgz",
-      "integrity": "sha1-1hz+LOBZ9BTYmendbUEH7iVnDDg="
+      "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz",
+      "integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA=="
     },
     "file-type": {
       "version": "12.4.2",
@@ -6455,8 +6534,8 @@
     },
     "frac": {
       "version": "1.1.2",
-      "resolved": "https://registry.npm.taobao.org/frac/download/frac-1.1.2.tgz",
-      "integrity": "sha1-PXT39keMiKG1AgMG10fcYxPHTQs="
+      "resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz",
+      "integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA=="
     },
     "fragment-cache": {
       "version": "0.2.1",
@@ -10936,8 +11015,8 @@
     },
     "printj": {
       "version": "1.1.2",
-      "resolved": "https://registry.npm.taobao.org/printj/download/printj-1.1.2.tgz",
-      "integrity": "sha1-2Q3rKXWoufYA+zoclOP0xTx4oiI="
+      "resolved": "https://registry.npmjs.org/printj/-/printj-1.1.2.tgz",
+      "integrity": "sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ=="
     },
     "process": {
       "version": "0.11.10",
@@ -12365,8 +12444,8 @@
     },
     "ssf": {
       "version": "0.11.2",
-      "resolved": "https://registry.npm.taobao.org/ssf/download/ssf-0.11.2.tgz",
-      "integrity": "sha1-C5lpiyN1SNCI/EPN8rcMGnUSwGw=",
+      "resolved": "https://registry.npmjs.org/ssf/-/ssf-0.11.2.tgz",
+      "integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==",
       "requires": {
         "frac": "~1.1.2"
       }
@@ -13626,87 +13705,6 @@
         }
       }
     },
-    "vue-loader-v16": {
-      "version": "npm:vue-loader@16.2.0",
-      "resolved": "https://registry.npm.taobao.org/vue-loader/download/vue-loader-16.2.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-loader%2Fdownload%2Fvue-loader-16.2.0.tgz",
-      "integrity": "sha1-BGpTMI3Ufljv4g3ewe3sAnzjtG4=",
-      "dev": true,
-      "optional": true,
-      "requires": {
-        "chalk": "^4.1.0",
-        "hash-sum": "^2.0.0",
-        "loader-utils": "^2.0.0"
-      },
-      "dependencies": {
-        "ansi-styles": {
-          "version": "4.3.0",
-          "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.3.0.tgz",
-          "integrity": "sha1-7dgDYornHATIWuegkG7a00tkiTc=",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "color-convert": "^2.0.1"
-          }
-        },
-        "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.nlark.com/chalk/download/chalk-4.1.1.tgz?cache=0&sync_timestamp=1618995384030&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fchalk%2Fdownload%2Fchalk-4.1.1.tgz",
-          "integrity": "sha1-yAs/qyi/Y3HmhjMl7uZ+YYt35q0=",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "ansi-styles": "^4.1.0",
-            "supports-color": "^7.1.0"
-          }
-        },
-        "color-convert": {
-          "version": "2.0.1",
-          "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz",
-          "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "color-name": "~1.1.4"
-          }
-        },
-        "color-name": {
-          "version": "1.1.4",
-          "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz",
-          "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=",
-          "dev": true,
-          "optional": true
-        },
-        "has-flag": {
-          "version": "4.0.0",
-          "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz",
-          "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=",
-          "dev": true,
-          "optional": true
-        },
-        "loader-utils": {
-          "version": "2.0.0",
-          "resolved": "https://registry.npm.taobao.org/loader-utils/download/loader-utils-2.0.0.tgz",
-          "integrity": "sha1-5MrOW4FtQloWa18JfhDNErNgZLA=",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "big.js": "^5.2.2",
-            "emojis-list": "^3.0.0",
-            "json5": "^2.1.2"
-          }
-        },
-        "supports-color": {
-          "version": "7.2.0",
-          "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.2.0.tgz?cache=0&sync_timestamp=1618561008172&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.2.0.tgz",
-          "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "has-flag": "^4.0.0"
-          }
-        }
-      }
-    },
     "vue-pdf": {
       "version": "4.2.0",
       "resolved": "https://registry.npm.taobao.org/vue-pdf/download/vue-pdf-4.2.0.tgz",
@@ -14485,13 +14483,13 @@
     },
     "wmf": {
       "version": "1.0.2",
-      "resolved": "https://registry.npm.taobao.org/wmf/download/wmf-1.0.2.tgz",
-      "integrity": "sha1-fRnWIQcaCMK9xrfmiKnENSmMwto="
+      "resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz",
+      "integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw=="
     },
     "word": {
       "version": "0.3.0",
-      "resolved": "https://registry.npm.taobao.org/word/download/word-0.3.0.tgz",
-      "integrity": "sha1-hUIVfk+OhJ9KNjooiZLUdhLbmWE="
+      "resolved": "https://registry.npmjs.org/word/-/word-0.3.0.tgz",
+      "integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA=="
     },
     "worker-farm": {
       "version": "1.7.0",
@@ -14591,8 +14589,8 @@
     },
     "xlsx": {
       "version": "0.17.0",
-      "resolved": "https://registry.nlark.com/xlsx/download/xlsx-0.17.0.tgz",
-      "integrity": "sha1-AoF2oBQJZ9zuGBfSIWeEYeR0gcg=",
+      "resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.17.0.tgz",
+      "integrity": "sha512-bZ36FSACiAyjoldey1+7it50PMlDp1pcAJrZKcVZHzKd8BC/z6TQ/QAN8onuqcepifqSznR6uKnjPhaGt6ig9A==",
       "requires": {
         "adler-32": "~1.2.0",
         "cfb": "^1.1.4",
@@ -14608,13 +14606,13 @@
       "dependencies": {
         "commander": {
           "version": "2.17.1",
-          "resolved": "https://registry.nlark.com/commander/download/commander-2.17.1.tgz?cache=0&sync_timestamp=1621726670324&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcommander%2Fdownload%2Fcommander-2.17.1.tgz",
-          "integrity": "sha1-vXerfebelCBc6sxy8XFtKfIKd78="
+          "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz",
+          "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg=="
         },
         "fflate": {
           "version": "0.3.11",
-          "resolved": "https://registry.nlark.com/fflate/download/fflate-0.3.11.tgz?cache=0&sync_timestamp=1621791371905&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ffflate%2Fdownload%2Ffflate-0.3.11.tgz",
-          "integrity": "sha1-LEQNcYD964GeZImNiFivMnsEKl0="
+          "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.3.11.tgz",
+          "integrity": "sha512-Rr5QlUeGN1mbOHlaqcSYMKVpPbgLy0AWT/W0EHxA6NGI12yO1jpoui2zBBvU2G824ltM6Ut8BFgfHSBGfkmS0A=="
         }
       }
     },

+ 1 - 1
package.json

@@ -3,7 +3,7 @@
   "version": "0.1.0",
   "private": true,
   "scripts": {
-	"start": "npm run server",
+    "start": "npm run server",
     "server": "vue-cli-service serve && webpack-dev-server --open",
     "dev": "vue-cli-service build --mode development",
     "test": "vue-cli-service build --mode test",

+ 1 - 2
src/api/axios.js

@@ -43,7 +43,7 @@ export function requestData (options) {
     // 创建请求实例
     const XHRReq = axios.create({
       headers,
-      baseURL: process.env.VUE_APP_API_URL || '/api/',
+      baseURL: process.env.VUE_APP_LOCALTEST_URL || '/api/',
       timeout: options.timeout || 3000,
     });
 
@@ -69,7 +69,6 @@ export function requestData (options) {
       if (options.showLoading) {
         store.state.loading = false;
       }
-      debugger
       if (response.code === 501) { // 用户类请求错误code (账号密码错误、用户锁定、token过期等)
         localStorage.removeItem('authToken');
         Message.error(response.data.msg);

+ 14 - 2
src/components/common/menu.vue

@@ -30,11 +30,23 @@ export default {
     fIndex: String, // 父元素的index值
   },
   mounted () {
-    this.init();
+    this.$nextTick(() => {
+      this.getMenu();
+    });
   },
   methods: {
     //初始化
-    init () { },
+    getMenu () {
+      this.API.requestData({
+        showLoading: true, // 请求是否显示加载中遮罩层,默认 false ,可缺省
+        subUrl: "admin/usermenu", // 请求接口地址,必传项
+        success (res) {
+          // 请求成功的回调
+          console.log('res', res);
+        }
+      });
+    },
+
     // 菜单点击跳转
     menuC (item) {
       debugger