瀏覽代碼

接口链接

guhongwei 2 年之前
父節點
當前提交
044368c40c
共有 3 個文件被更改,包括 14 次插入4 次删除
  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 Vuex from 'vuex';
+import admin from '@common/src/store/admin';
 
 Vue.use(Vuex);
 
@@ -8,5 +9,5 @@ export default new Vuex.Store({
   getters: {},
   mutations: {},
   actions: {},
-  modules: {},
+  modules: { admin },
 });

+ 11 - 2
src/views/homeIndex.vue

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

+ 1 - 1
vue.config.js

@@ -23,7 +23,7 @@ module.exports = {
         target: 'http://broadcast.waityou24.cn',
       },
       '/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,
         ws: false,
       },