Browse Source

反向代理完成

zhangming 4 years ago
parent
commit
9a5479a092
3 changed files with 3 additions and 4 deletions
  1. 1 1
      .env.development
  2. 1 2
      src/http.js
  3. 1 1
      src/views/About.vue

+ 1 - 1
.env.development

@@ -1 +1 @@
-VUE_APP_API_URL=http://192.168.1.14:8011
+VUE_APP_API_URL=http://192.168.1.14:8011/

+ 1 - 2
src/http.js

@@ -3,9 +3,8 @@ import Vue from 'vue'
 import router from './router'
 
 const http = axios.create({
-  baseURL: process.env.VUE_APP_API_URL || '/api',
+  baseURL: process.env.VUE_APP_API_URL || '/api/',
   // baseURL: process.env.VUE_APP_API_URL,
-  // baseURL: 'http://192.168.10.168:8080'
 })
 
 

+ 1 - 1
src/views/About.vue

@@ -19,7 +19,7 @@ export default {
   methods: {
     fetch() {
       this.$http
-        .get("/thing/station")
+        .get("thing/station")
         .then((res) => {
           console.log(res.data);
           this.data = res.data;