guhongwei il y a 2 ans
Parent
commit
487076bb66
5 fichiers modifiés avec 20 ajouts et 8 suppressions
  1. 1 1
      public/index.html
  2. 2 2
      src/router/module/common.js
  3. 4 1
      src/store/index.js
  4. 12 3
      src/views/home/index.vue
  5. 1 1
      vue.config.js

+ 1 - 1
public/index.html

@@ -5,7 +5,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-    <title><%= htmlWebpackPlugin.options.title %></title>
+    <title>加载中...</title>
   </head>
   </head>
   <body>
   <body>
     <noscript>
     <noscript>

+ 2 - 2
src/router/module/common.js

@@ -15,12 +15,12 @@ export default [
   },
   },
   {
   {
     path: '/homeIndex',
     path: '/homeIndex',
-    meta: { title: '管理平台', is_filter: true },
+    meta: { title: '台', is_filter: true },
     component: () => import('@common/src/components/admin-frame/home.vue'),
     component: () => import('@common/src/components/admin-frame/home.vue'),
     children: [
     children: [
       {
       {
         path: '/homeIndex',
         path: '/homeIndex',
-        meta: { title: '管理平台', is_filter: true },
+        meta: { title: '台', is_filter: true },
         component: () => import('@/views/home/index.vue'),
         component: () => import('@/views/home/index.vue'),
       },
       },
       {
       {

+ 4 - 1
src/store/index.js

@@ -2,6 +2,9 @@ import Vue from 'vue';
 import Vuex from 'vuex';
 import Vuex from 'vuex';
 import * as ustate from '@common/src/store/user/state';
 import * as ustate from '@common/src/store/user/state';
 import * as umutations from '@common/src/store/user/mutations';
 import * as umutations from '@common/src/store/user/mutations';
+// 管理员
+import admin from '@common/src/store/admin';
+
 Vue.use(Vuex);
 Vue.use(Vuex);
 
 
 export default new Vuex.Store({
 export default new Vuex.Store({
@@ -9,5 +12,5 @@ export default new Vuex.Store({
   getters: {},
   getters: {},
   mutations: { ...umutations },
   mutations: { ...umutations },
   actions: {},
   actions: {},
-  modules: {},
+  modules: { admin },
 });
 });

+ 12 - 3
src/views/home/index.vue

@@ -1,13 +1,14 @@
 <template>
 <template>
   <div id="index">
   <div id="index">
     <el-row>
     <el-row>
-      <el-col :span="24" class="main animate__animated animate__backInRight"> test </el-col>
+      <el-col :span="24" class="main animate__animated animate__backInRight"> 系统首页 </el-col>
     </el-row>
     </el-row>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('admin');
 export default {
 export default {
   name: 'index',
   name: 'index',
   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,
       },
       },