reedliuqing_i 6 jaren geleden
bovenliggende
commit
430766573d
6 gewijzigde bestanden met toevoegingen van 48 en 46 verwijderingen
  1. 1 1
      src/api/interface.js
  2. 1 1
      src/api/rule.js
  3. 1 1
      src/components/Breadcrumb/index.vue
  4. 14 12
      src/layout/components/Navbar.vue
  5. 8 8
      src/router/index.js
  6. 23 23
      src/views/home/index.vue

+ 1 - 1
src/api/interface.js

@@ -2,7 +2,7 @@ import request from '@/utils/request'
 
 // ================================== Interface ======================================
 
-const mockUrl = 'http://mock.Intra.xiaojukeji.com/'
+const mockUrl = 'http://mock.Intra.xiaojukeji.com'
 
 export function fetchEnvInfo(envChannel) {
   return request({

+ 1 - 1
src/api/rule.js

@@ -1,7 +1,7 @@
 import request from '@/utils/request'
 
 // ================================== Rule ======================================
-const mockUrl = 'http://mock.Intra.xiaojukeji.com/'
+const mockUrl = 'http://mock.Intra.xiaojukeji.com'
 
 export function fetchRuleById(data) {
   return request({

+ 1 - 1
src/components/Breadcrumb/index.vue

@@ -33,7 +33,7 @@ export default {
       const first = matched[0]
 
       if (!this.isDashboard(first)) {
-        matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched)
+        matched = [{ path: '/home/dashboard', meta: { title: 'Dashboard' }}].concat(matched)
       }
 
       this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)

+ 14 - 12
src/layout/components/Navbar.vue

@@ -5,7 +5,7 @@
     <breadcrumb class="breadcrumb-container" />
 
     <div class="right-menu">
-      <el-dropdown class="avatar-container" trigger="click">
+      <el-dropdown class="avatar-container" trigger="click" @command="handleCommand">
         <div class="avatar-wrapper">
           <img :src="navbarLogo.src" class="user-avatar">
           <i class="el-icon-caret-bottom" />
@@ -16,14 +16,8 @@
               Home
             </el-dropdown-item>
           </router-link>
-          <!-- <a target="_blank" href="https://github.com/PanJiaChen/vue-admin-template/">
-            <el-dropdown-item>Github</el-dropdown-item>
-          </a>
-          <a target="_blank" href="https://panjiachen.github.io/vue-element-admin-site/#/">
-            <el-dropdown-item>Docs</el-dropdown-item>
-          </a> -->
-          <el-dropdown-item divided>
-            <span style="display:block;" @click="logout">Log Out</span>
+          <el-dropdown-item divided command="b">
+            <span style="display:block;">Log Out</span>
           </el-dropdown-item>
         </el-dropdown-menu>
       </el-dropdown>
@@ -60,9 +54,17 @@ export default {
     toggleSideBar() {
       this.$store.dispatch('app/toggleSideBar')
     },
-    async logout() {
-      await this.$store.dispatch('user/logout')
-      this.$router.push(`/login?redirect=${this.$route.fullPath}`)
+    logout() {
+      // await this.$store.dispatch('user/logout')
+      // this.$router.push(`/login?redirect=${this.$route.fullPath}`)
+      location.href = 'http://10.179.209.19:8899/logout'
+    },
+    handleCommand(command) {
+      switch (command) {
+        case 'b':
+          this.logout()
+          break
+      }
     }
   }
 }

+ 8 - 8
src/router/index.js

@@ -53,7 +53,7 @@ export const constantRoutes = [
   },
 
   {
-    path: '/',
+    path: '/home',
     component: Layout,
     redirect: '/dashboard',
     children: [{
@@ -75,14 +75,14 @@ export const constantRoutes = [
         path: 'interface',
         name: 'Interface',
         component: () => import('@/views/mock/interface'),
-        meta: { title: '接口', icon: 'interface' }
-      },
-      {
-        path: 'interface/:rule',
-        name: 'Rule',
-        component: () => import('@/views/mock/rule'),
-        meta: { title: '规则', icon: 'rule' }
+        meta: { title: 'Mock服务', icon: 'interface' }
       }
+      // {
+      //   path: 'interface/:rule',
+      //   name: 'Rule',
+      //   component: () => import('@/views/mock/rule'),
+      //   meta: { title: '规则', icon: 'rule' }
+      // }
     ]
   },
 

+ 23 - 23
src/views/home/index.vue

@@ -8,11 +8,11 @@
       @select="handleSelect"
     >
       <el-image class="logo" :src="logoImage" fit="fill" />
-      <el-menu-item style="margin-left: 18.5%" index="1" disabled>流程管控</el-menu-item>
-      <el-menu-item index="2" disabled>自动化</el-menu-item>
+      <el-menu-item style="margin-left: 18.5%" index="1">环境平台</el-menu-item>
+      <el-menu-item index="2">服务mock</el-menu-item>
       <el-menu-item index="3" disabled>数据中心</el-menu-item>
-      <el-menu-item index="4">环境平台</el-menu-item>
-      <el-menu-item index="5">服务mock</el-menu-item>
+      <el-menu-item index="4" disabled>流程管控</el-menu-item>
+      <el-menu-item index="5" disabled>自动化</el-menu-item>
       <el-menu-item index="6" disabled>虚拟硬件</el-menu-item>
       <div class="div-login"><svg-icon icon-class="yonghu" /> {{ realname }}</div>
     </el-menu>
@@ -23,15 +23,15 @@
     </div>
     <div class="div-main" style="height: 600pt;width 100%;text-align: center;">
       <div style="font-size: 21pt;margin-top: 54pt;color: #333333;">功能介绍</div>
-      <el-card disabled class="expect" style="margin-left: 0;margin-top: 42pt" shadow="never" @click.native="handleSelect('1')">
-        <img class="image-module-logo" src="@/assets/home_images/功能介绍_icon_流程管控未上线@3x.png">
-        <div class="div-title" style="color: #999999">流程管控-敬请期待</div>
-        <div class="div-module-introduction">简单、明了、一站式流程管理</div>
+      <el-card disabled style="margin-left: 0;margin-top: 42pt" shadow="never" @click.native="handleSelect('1')">
+        <img class="image-module-logo" src="@/assets/home_images/功能介绍_icon_环境平台@3x.png">
+        <div class="div-title">环境平台</div>
+        <div class="div-module-introduction">全面综合的个性化环境服务</div>
       </el-card>
-      <el-card class="expect" shadow="never" @click.native="handleSelect('2')">
-        <img class="image-module-logo" src="@/assets/home_images/功能介绍_icon_自动化未上线@3x.png">
-        <div class="div-title" style="color: #999999">自动化-敬请期待</div>
-        <div class="div-module-introduction">这是一段关于该功能的结束,结束文字控在两行内</div>
+      <el-card shadow="never" @click.native="handleSelect('2')">
+        <img class="image-module-logo" src="@/assets/home_images/功能介绍_icon_服务mock@3x.png">
+        <div class="div-title">服务mock</div>
+        <div class="div-module-introduction">灵活稳定的Mock服务</div>
       </el-card>
       <el-card class="expect" shadow="never" @click.native="handleSelect('3')">
         <img class="image-module-logo" src="@/assets/home_images/功能介绍_icon_数据中心未上线@3x.png">
@@ -39,20 +39,20 @@
         <div class="div-module-introduction">数据构造、统计、备份、分析</div>
       </el-card>
       <br>
-      <el-card style="margin-left: 0;margin-top: 36pt;" shadow="hover" @click.native="handleSelect('4')">
-        <img class="image-module-logo" src="@/assets/home_images/功能介绍_icon_环境平台@3x.png">
-        <div class="div-title">环境平台</div>
-        <div class="div-module-introduction">全面综合的个性化环境服务</div>
+      <el-card class="expect" style="margin-left: 0;margin-top: 36pt;" shadow="hover" @click.native="handleSelect('4')">
+        <img class="image-module-logo" src="@/assets/home_images/功能介绍_icon_流程管控未上线@3x.png">
+        <div class="div-title" style="color: #999999">流程管控-敬请期待</div>
+        <div class="div-module-introduction">简单、明了、一站式流程管理</div>
       </el-card>
-      <el-card shadow="hover" @click.native="handleSelect('5')">
-        <img class="image-module-logo" src="@/assets/home_images/功能介绍_icon_服务mock@3x.png">
-        <div class="div-title">服务mock</div>
-        <div class="div-module-introduction">灵活稳定的Mock服务</div>
+      <el-card class="expect" shadow="hover" @click.native="handleSelect('5')">
+        <img class="image-module-logo" src="@/assets/home_images/功能介绍_icon_自动化未上线@3x.png">
+        <div class="div-title" style="color: #999999">自动化-敬请期待</div>
+        <div class="div-module-introduction">这是一段关于该功能的结束,结束文字控在两行内</div>
       </el-card>
       <el-card class="expect" shadow="never" @click.native="handleSelect('6')">
         <img class="image-module-logo" src="@/assets/home_images/功能介绍_icon_虚拟硬件未上线@3x.png">
         <div class="div-title" style="color: #999999">虚拟硬件-敬请期待</div>
-        <div class="div-module-introduction">让测试更美好</div>
+        <div class="div-module-introduction">设备一键生成,自由管控</div>
       </el-card>
     </div>
     <div style="height: 180pt;width 100%;background-color: #1B2341;">
@@ -258,10 +258,10 @@ export default {
   methods: {
     handleSelect(key, keyPath) {
       switch (key) {
-        case '4' :
+        case '1' :
           this.$router.push({ name: '环境' })
           break
-        case '5' :
+        case '2' :
           this.$router.push({ name: 'Mock' })
       }
     },