D4THYL3\long 3 anos atrás
pai
commit
c1cfb9929d
6 arquivos alterados com 104 adições e 7 exclusões
  1. 52 0
      package-lock.json
  2. 11 1
      package.json
  3. 21 1
      src/main.js
  4. 8 5
      src/router/index.js
  5. 3 0
      src/views/Gis.vue
  6. 9 0
      vue.config.js

+ 52 - 0
package-lock.json

@@ -3002,6 +3002,58 @@
         "yaml": "^1.10.0"
       }
     },
+    "cross-env": {
+      "version": "7.0.3",
+      "resolved": "https://registry.npmmirror.com/cross-env/-/cross-env-7.0.3.tgz",
+      "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==",
+      "dev": true,
+      "requires": {
+        "cross-spawn": "^7.0.1"
+      },
+      "dependencies": {
+        "cross-spawn": {
+          "version": "7.0.3",
+          "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.3.tgz",
+          "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
+          "dev": true,
+          "requires": {
+            "path-key": "^3.1.0",
+            "shebang-command": "^2.0.0",
+            "which": "^2.0.1"
+          }
+        },
+        "path-key": {
+          "version": "3.1.1",
+          "resolved": "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz",
+          "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
+          "dev": true
+        },
+        "shebang-command": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz",
+          "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
+          "dev": true,
+          "requires": {
+            "shebang-regex": "^3.0.0"
+          }
+        },
+        "shebang-regex": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmmirror.com/shebang-regex/-/shebang-regex-3.0.0.tgz",
+          "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
+          "dev": true
+        },
+        "which": {
+          "version": "2.0.2",
+          "resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz",
+          "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
+          "dev": true,
+          "requires": {
+            "isexe": "^2.0.0"
+          }
+        }
+      }
+    },
     "cross-spawn": {
       "version": "6.0.5",
       "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-6.0.5.tgz",

+ 11 - 1
package.json

@@ -4,6 +4,10 @@
   "private": true,
   "scripts": {
     "serve": "vue-cli-service serve",
+    "dev": "vue-cli-service serve",
+    "dev-sit": "vue-cli-service serve --mode sit",
+    "dev-production": "vue-cli-service serve --mode production",
+    "build-sit": "vue-cli-service build --mode sit",
     "build": "vue-cli-service build"
   },
   "dependencies": {
@@ -19,6 +23,7 @@
     "@vue/cli-plugin-router": "~5.0.0",
     "@vue/cli-plugin-vuex": "~5.0.0",
     "@vue/cli-service": "~5.0.0",
+    "cross-env": "^7.0.3",
     "sass": "^1.32.7",
     "sass-loader": "^12.0.0",
     "vue-template-compiler": "^2.6.14"
@@ -27,5 +32,10 @@
     "> 1%",
     "last 2 versions",
     "not dead"
-  ]
+  ],
+  "description": "## Project setup ``` npm install ```",
+  "main": "babel.config.js",
+  "keywords": [],
+  "author": "",
+  "license": "ISC"
 }

+ 21 - 1
src/main.js

@@ -12,10 +12,30 @@ Vue.use(ElementUI);
 Vue.config.productionTip = false
 
 
+
+
+var http = axios.create({
+  timout: 30
+});
+
+
+http.interceptors.request.use((config) => { config.url = '/sc-oa'});
+console.log(http.interceptors.request.use());
+
 Vue.prototype.$axios = axios       
-Vue.prototype.$http = axios
+Vue.prototype.$http = http
+
 
 
+// 高德地图
+import VueAMap from 'vue-amap';
+Vue.use(VueAMap);
+ // 初始化高德地图的 key 和插件
+VueAMap.initAMapApiLoader({
+  key: 'c76c4e9a861fe1f715c48d893d07116b',
+  plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor'],
+  v: '1.4.4'
+});
 
 
 new Vue({

+ 8 - 5
src/router/index.js

@@ -11,26 +11,29 @@ const routes = [
   {
     path: '/home',
     name: 'homeview',
-    component: HomeView
+    component: HomeView,
   },{
     path:'/about',
     name:'aboutview',
-    component:AboutView
+    component:AboutView,
   },{
     path:'/details',
     name:'details',
-    component:Details
+    component:Details,
   },{
     path:'/gis',
     name:'gis',
-    component:Gis
+    component:Gis,
   }
 ]
 
 const router = new VueRouter({
   mode: 'history',
-  base: process.env.BASE_URL,
+  base: '/sc-oa',
   routes
 })
 
+console.log(router);
+
+
 export default router

+ 3 - 0
src/views/Gis.vue

@@ -0,0 +1,3 @@
+<template>
+
+</template>>

+ 9 - 0
vue.config.js

@@ -1,5 +1,6 @@
 const { defineConfig } = require('@vue/cli-service')
 module.exports = defineConfig({
+publicPath:  '/sc-oa',
   transpileDependencies: true,
   devServer: {
     host: 'localhost', // 本地地址
@@ -19,6 +20,13 @@ module.exports = defineConfig({
             pathRewrite: { // pathRewrite的作用是把请求接口中的 '/api'替换掉,一般是替换为空""
             }
         },
+        '/sc-oa' : { // '/api'是代理标识,一般是每个接口前的相同部分
+            target: "http://114.135.61.186:21020/sc-oa", // 请求地址,一般是服务器地址
+            changeOrigin: true, // 是否进行跨域
+            secure:true,
+            pathRewrite: { // pathRewrite的作用是把请求接口中的 '/api'替换掉,一般是替换为空""
+            }
+        },
         '/UMIS_FILE':{
             target: "http://114.135.61.186:21020/sc-login/nav", // 请求地址,一般是服务器地址
             changeOrigin: true, // 是否进行跨域
@@ -29,3 +37,4 @@ module.exports = defineConfig({
     }
 }
 })
+