Browse Source

接口链接

guhongwei 2 years ago
parent
commit
044368c40c
3 changed files with 14 additions and 4 deletions
  1. 2 1
      src/store/index.js
  2. 11 2
      src/views/homeIndex.vue
  3. 1 1
      vue.config.js

+ 2 - 1
src/store/index.js

@@ -1,5 +1,6 @@
 import Vue from 'vue';
 import Vue from 'vue';
 import Vuex from 'vuex';
 import Vuex from 'vuex';
+import admin from '@common/src/store/admin';
 
 
 Vue.use(Vuex);
 Vue.use(Vuex);
 
 
@@ -8,5 +9,5 @@ export default new Vuex.Store({
   getters: {},
   getters: {},
   mutations: {},
   mutations: {},
   actions: {},
   actions: {},
-  modules: {},
+  modules: { admin },
 });
 });

+ 11 - 2
src/views/homeIndex.vue

@@ -8,6 +8,7 @@
 
 
 <script>
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('admin');
 export default {
 export default {
   name: 'homeIndex',
   name: 'homeIndex',
   props: {},
   props: {},
@@ -15,8 +16,16 @@ export default {
   data: function () {
   data: function () {
     return {};
     return {};
   },
   },
-  created() {},
-  methods: {},
+  created() {
+    this.search();
+  },
+  methods: {
+    ...mapActions(['query']),
+    async search() {
+      let res = await this.query();
+      console.log(res);
+    },
+  },
   computed: {
   computed: {
     ...mapState(['user']),
     ...mapState(['user']),
   },
   },

+ 1 - 1
vue.config.js

@@ -23,7 +23,7 @@ module.exports = {
         target: 'http://broadcast.waityou24.cn',
         target: 'http://broadcast.waityou24.cn',
       },
       },
       '/projectadmin/api': {
       '/projectadmin/api': {
-        target: 'http://192.168.1.144:10101', //http://192.168.1.144:16001
+        target: 'http://127.0.0.1:10102', //http://192.168.1.144:16001
         changeOrigin: true,
         changeOrigin: true,
         ws: false,
         ws: false,
       },
       },