guhongwei 2 vuotta sitten
vanhempi
commit
00c8b760c8
4 muutettua tiedostoa jossa 16 lisäystä ja 5 poistoa
  1. 1 1
      src/router/index.js
  2. 3 1
      src/store/index.js
  3. 11 2
      src/views/homeIndex.vue
  4. 1 1
      vue.config.js

+ 1 - 1
src/router/index.js

@@ -4,7 +4,7 @@ Vue.use(VueRouter);
 const routes = [
   {
     path: '/',
-    meta: { title: '系统首页' },
+    meta: { title: '公众号' },
     component: () => import('../views/homeIndex.vue'),
   },
 ];

+ 3 - 1
src/store/index.js

@@ -2,6 +2,8 @@ import Vue from 'vue';
 import Vuex from 'vuex';
 import * as ustate from '@common/src/store/user/state';
 import * as umutations from '@common/src/store/user/mutations';
+// 管理员
+import admin from '@common/src/store/admin';
 Vue.use(Vuex);
 
 export default new Vuex.Store({
@@ -9,5 +11,5 @@ export default new Vuex.Store({
   getters: {},
   mutations: { ...umutations },
   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,
       },