فهرست منبع

首页开发完成

reedliuqing_i 6 سال پیش
والد
کامیت
7d4b949b32

+ 1 - 1
.env.development

@@ -2,7 +2,7 @@
 ENV = 'development'
 
 # base api
-VUE_APP_BASE_API = 'http://mock.Intra.xiaojukeji.com/'
+# VUE_APP_BASE_API = 'http://mock.Intra.xiaojukeji.com/'
 
 # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
 # to control whether the babel-plugin-dynamic-import-node plugin is enabled.

+ 1 - 1
.env.production

@@ -2,5 +2,5 @@
 ENV = 'production'
 
 # base api
-VUE_APP_BASE_API = 'http://mock.Intra.xiaojukeji.com/'
+# VUE_APP_BASE_API = 'http://mock.Intra.xiaojukeji.com/'
 

+ 9 - 7
src/api/interface.js

@@ -2,9 +2,11 @@ import request from '@/utils/request'
 
 // ================================== Interface ======================================
 
+const mockUrl = 'http://mock.Intra.xiaojukeji.com/'
+
 export function fetchEnvInfo(envChannel) {
   return request({
-    url: '/api/mock/envConfig/getAllEnvConfigByChannel',
+    url: mockUrl + '/api/mock/envConfig/getAllEnvConfigByChannel',
     method: 'get',
     params: { channelId: envChannel }
   })
@@ -12,7 +14,7 @@ export function fetchEnvInfo(envChannel) {
 
 export function fetchServiceById(data) {
   return request({
-    url: '/api/mock/methodConfig/query',
+    url: mockUrl + '/api/mock/methodConfig/query',
     method: 'post',
     data
   })
@@ -20,7 +22,7 @@ export function fetchServiceById(data) {
 
 export function fetchServiceList(data) {
   return request({
-    url: '/api/mock/methodConfig/query',
+    url: mockUrl + '/api/mock/methodConfig/query',
     method: 'post',
     data
   })
@@ -28,7 +30,7 @@ export function fetchServiceList(data) {
 
 export function fetchConsumerList() {
   return request({
-    url: '/api/mock/dubboConsumer/getAll',
+    url: mockUrl + '/api/mock/dubboConsumer/getAll',
     method: 'get',
     params: {}
   })
@@ -36,7 +38,7 @@ export function fetchConsumerList() {
 
 export function createService(data) {
   return request({
-    url: '/api/mock/methodConfig/add',
+    url: mockUrl + '/api/mock/methodConfig/add',
     method: 'post',
     data
   })
@@ -44,7 +46,7 @@ export function createService(data) {
 
 export function updateService(data) {
   return request({
-    url: '/api/mock/methodConfig/update',
+    url: mockUrl + '/api/mock/methodConfig/update',
     method: 'post',
     data
   })
@@ -52,7 +54,7 @@ export function updateService(data) {
 
 export function changeStatus(data) {
   return request({
-    url: '/api/mock/methodConfig/changeStatus',
+    url: mockUrl + '/api/mock/methodConfig/changeStatus',
     method: 'post',
     data
   })

+ 6 - 5
src/api/rule.js

@@ -1,10 +1,11 @@
 import request from '@/utils/request'
 
 // ================================== Rule ======================================
+const mockUrl = 'http://mock.Intra.xiaojukeji.com/'
 
 export function fetchRuleById(data) {
   return request({
-    url: '/api/mock/mockRule/query',
+    url: mockUrl + '/api/mock/mockRule/query',
     method: 'post',
     data
   })
@@ -12,7 +13,7 @@ export function fetchRuleById(data) {
 
 export function fetchRuleList(data) {
   return request({
-    url: '/api/mock/mockRule/query',
+    url: mockUrl + '/api/mock/mockRule/query',
     method: 'post',
     data
   })
@@ -20,7 +21,7 @@ export function fetchRuleList(data) {
 
 export function createRule(data) {
   return request({
-    url: '/api/mock/mockRule/add',
+    url: mockUrl + '/api/mock/mockRule/add',
     method: 'post',
     data
   })
@@ -28,7 +29,7 @@ export function createRule(data) {
 
 export function updateRule(data) {
   return request({
-    url: '/api/mock/mockRule/update',
+    url: mockUrl + '/api/mock/mockRule/update',
     method: 'post',
     data
   })
@@ -36,7 +37,7 @@ export function updateRule(data) {
 
 export function changeStatus(data) {
   return request({
-    url: '/api/mock/mockRule/changeStatus',
+    url: mockUrl + '/api/mock/mockRule/changeStatus',
     method: 'post',
     data
   })

+ 1 - 1
src/api/table.js

@@ -1,6 +1,6 @@
 import request from '@/utils/request'
 
-const mockUrl = 'http://mock.Intra.xiaojukeji.com/'
+const mockUrl = 'http://mock.Intra.xiaojukeji.com'
 
 export function getList(params) {
   return request({

+ 9 - 0
src/api/user.js

@@ -1,5 +1,14 @@
 import request from '@/utils/request'
 
+const envUrl = 'http://10.179.209.19:8899'
+
+export function getUserInfo() {
+  return request({
+    url: envUrl + '/user',
+    method: 'get'
+  })
+}
+
 export function login(data) {
   return request({
     url: '/user/login',

BIN
src/assets/home_images/功能介绍_icon_敬请期待@3x.png


BIN
src/assets/home_images/功能介绍_icon_数据中心未上线@3x.png


BIN
src/assets/home_images/功能介绍_icon_服务mock未上线@3x.png


BIN
src/assets/home_images/功能介绍_icon_流程管控未上线@3x.png


BIN
src/assets/home_images/功能介绍_icon_环境平台未上线@3x.png


BIN
src/assets/home_images/功能介绍_icon_自动化未上线@3x.png


BIN
src/assets/home_images/功能介绍_icon_虚拟硬件未上线@3x.png


+ 1 - 1
src/icons/svg/Float_icon_二维码_蓝色.svg

@@ -3,7 +3,7 @@
 <svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
 	 viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve">
 <style type="text/css">
-	.st0{fill:dodgerblue;}
+	.st0{fill:#0FE3FF;}
 </style>
 <g id="页面1">
 	<g id="thoth_homepage" transform="translate(-1393.000000, -1477.000000)">

+ 1 - 1
src/icons/svg/Float_icon_反馈_蓝色.svg

@@ -3,7 +3,7 @@
 <svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
 	 viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve">
 <style type="text/css">
-	.st0{fill:dodgerblue;}
+	.st0{fill:#0FE3FF;}
 </style>
 <g id="页面1">
 	<g id="thoth_homepage" transform="translate(-1393.000000, -1521.000000)">

+ 1 - 0
src/icons/svg/yonghu.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#bfcbd9" d="M501.041414 62.931285c125.654838 0 227.51269 100.19498 227.51269 223.775576 0 123.605156-101.856829 223.805252-227.51269 223.805252-125.650745 0-227.506551-100.199073-227.506551-223.805252C273.53384 163.097612 375.424438 62.931285 501.041414 62.931285L501.041414 62.931285 501.041414 62.931285zM501.041414 62.931285c125.654838 0 227.51269 100.19498 227.51269 223.775576 0 123.605156-101.856829 223.805252-227.51269 223.805252-125.650745 0-227.506551-100.199073-227.506551-223.805252C273.53384 163.097612 375.424438 62.931285 501.041414 62.931285L501.041414 62.931285 501.041414 62.931285zM415.730423 585.125461l189.629895 0c162.314783 0 293.880237 129.387859 293.880237 289.057395l0 18.622126c0 62.922075-131.593084 65.313541-293.880237 65.313541L415.730423 958.118524c-162.319899 0-293.880237-0.092098-293.880237-65.313541l0-18.622126C121.852232 714.51332 253.411547 585.125461 415.730423 585.125461L415.730423 585.125461 415.730423 585.125461z" /></svg>

+ 1 - 1
src/layout/components/Navbar.vue

@@ -11,7 +11,7 @@
           <i class="el-icon-caret-bottom" />
         </div>
         <el-dropdown-menu slot="dropdown" class="user-dropdown">
-          <router-link to="/home">
+          <router-link to="/">
             <el-dropdown-item>
               Home
             </el-dropdown-item>

+ 1 - 1
src/router/index.js

@@ -47,7 +47,7 @@ export const constantRoutes = [
   },
 
   {
-    path: '/home',
+    path: '/',
     component: Home,
     hidden: true
   },

+ 57 - 5
src/utils/request.js

@@ -10,6 +10,8 @@ const service = axios.create({
   timeout: 5000 // request timeout
 })
 
+axios.defaults.withCredentials = true
+
 // request interceptor
 service.interceptors.request.use(
   config => {
@@ -73,11 +75,61 @@ service.interceptors.response.use(
   },
   error => {
     console.log('err' + error) // for debug
-    Message({
-      message: error.message,
-      type: 'error',
-      duration: 5 * 1000
-    })
+    if (error && error.response) {
+      switch (error.response.status) {
+        case 400:
+          error.message = '错误请求'
+          break
+        case 401:
+          error.message = '未授权,请重新登录'
+          break
+        case 403:
+          error.message = '拒绝访问'
+          break
+        case 404:
+          error.message = '请求错误,未找到该资源'
+          break
+        case 405:
+          error.message = '请求方法未允许'
+          break
+        case 408:
+          error.message = '请求超时'
+          break
+        case 500:
+          error.message = '服务器端出错'
+          break
+        case 501:
+          error.message = '网络未实现'
+          break
+        case 502:
+          error.message = '网络错误'
+          break
+        case 503:
+          error.message = '服务不可用'
+          break
+        case 504:
+          error.message = '网络超时'
+          break
+        case 505:
+          error.message = 'http版本不支持该请求'
+          break
+        default:
+          error.message = `未知错误${error.response.status}`
+      }
+      Message({
+        message: error.message,
+        type: 'warning',
+        duration: 5 * 1000
+      })
+    } else {
+      error.message = '登录中'
+      Message({
+        message: error.message,
+        type: 'warning',
+        duration: 5 * 1000
+      })
+      location.href = 'http://10.179.209.19:8899/'
+    }
     return Promise.reject(error)
   }
 )

+ 1 - 1
src/views/env/index.vue

@@ -9,7 +9,7 @@ export default {
   name: 'ENV',
   data() {
     return {
-      envUrl: 'http://172.23.163.54:8081/' + this.$route.name,
+      envUrl: 'http://10.179.181.222:8866/' + this.$route.name,
       iframeHeight: '720px'
     }
   },

+ 2 - 2
src/views/home/floatMenu.vue

@@ -104,8 +104,8 @@ export default {
         moduleName: '',
         content: ''
       },
-      typeOptions: ['反馈问题', '反馈bug'],
-      moduleNameOptions: ['流程管控', '自动化', '数据中心', '环境平台', '服务mock', '虚拟硬件']
+      typeOptions: ['反馈问题', '提出建议', '其他'],
+      moduleNameOptions: ['流程管控', '自动化', '数据中心', '环境平台', '服务mock', '虚拟硬件', '其他']
     }
   },
   methods: {

+ 43 - 29
src/views/home/index.vue

@@ -8,13 +8,13 @@
       @select="handleSelect"
     >
       <el-image class="logo" :src="logoImage" fit="fill" />
-      <el-menu-item style="margin-left: 18.5%" index="1">流程管控</el-menu-item>
-      <el-menu-item index="2">自动化</el-menu-item>
-      <el-menu-item index="3">数据中心</el-menu-item>
+      <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 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="6">虚拟硬件</el-menu-item>
-      <div class="div-login">登录</div>
+      <el-menu-item index="6" disabled>虚拟硬件</el-menu-item>
+      <div class="div-login"><svg-icon icon-class="yonghu" /> {{ realname }}</div>
     </el-menu>
     <div style="color: #FFFF">
       <div class="div-introduction"><span>Thoth综合测试平台</span><br><span style="font-size: 17pt">打造让每个研发测试都离不开的一站式综合工具平台</span></div>
@@ -23,35 +23,35 @@
     </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 style="margin-left: 0;margin-top: 42pt" shadow="hover" @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 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>
-      <el-card shadow="hover" @click.native="handleSelect('2')">
-        <img class="image-module-logo" src="@/assets/home_images/功能介绍_icon_自动化@3x.png">
-        <div class="div-title">自动化</div>
+      <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>
-      <el-card shadow="hover" @click.native="handleSelect('3')">
-        <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" shadow="never" @click.native="handleSelect('3')">
+        <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>
       <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>
+        <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">这是一段关于该功能的结束,结束文字控在两行内</div>
+        <div class="div-module-introduction">灵活稳定的Mock服务</div>
       </el-card>
-      <el-card shadow="hover" @click.native="handleSelect('6')">
-        <img class="image-module-logo" src="@/assets/home_images/功能介绍_icon_虚拟硬件@3x.png">
-        <div class="div-title">虚拟硬件</div>
+      <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>
       </el-card>
     </div>
@@ -92,15 +92,13 @@
   top: 18%;
 }
 div.div-login {
+  margin-top: 10px;
   color: #ffffff;
   display: inline-block;
   position: absolute;
-  padding: 0.6% 1.8% 0.6% 1.8%;
   font-size: 10pt;
   top: 22%;
   right: 8.3%;
-  border: 0.5pt solid #ffffff;
-  border-radius: 2px;
 }
 div.div-introduction{
   position: absolute;
@@ -137,18 +135,22 @@ div.div-footer2 > span {
 }
 .el-menu {
   border: none;
+  height: 68px;
   position: fixed;
   z-index: 10;
   width: 100%;
 }
 .el-menu-item {
+  padding-top: 1.5pt;
   height: 100%;
 }
 .is-active {
-  background-color: #27a0e4 !important;
+  color: #0FE3FF!important;
+  border-color: #0FE3FF!important;
 }
 .el-menu-item:hover {
-  background-color: #27a0e4 !important;
+  color: #0FE3FF!important;
+  background-color: transparent !important;
 }
 .float-menu-home {
   position: fixed;
@@ -168,7 +170,7 @@ div.div-footer2 > span {
 
 <style scoped>
 img.image-module-logo {
-  margin-top: 15%;
+  margin-top: 25pt;
   width: 20%;
 }
 div.div-title {
@@ -179,11 +181,14 @@ div.div-title {
 div.div-module-introduction {
   font-size: 10.5pt;
   color: #999999;
-  margin-top: 10pt;
+  margin-top: 7.5pt;
 }
 .el-card:hover{
   cursor: pointer;
 }
+.el-card.expect:hover {
+  cursor: not-allowed;
+}
 </style>
 
 <style scoped>
@@ -225,6 +230,7 @@ img.img-arrow {
 import FloatMenu from './floatMenu'
 import logoImage from '@/assets/home_images/nav_logo@3x.png'
 import bannerImage from '@/assets/home_images/banner_pic.png'
+import { getUserInfo } from '@/api/user.js'
 
 export default {
   components: {
@@ -235,11 +241,19 @@ export default {
       activeIndex2: '1',
       menuColor: 'transparent',
       logoImage: logoImage,
-      bannerImage: bannerImage
+      bannerImage: bannerImage,
+      processManage: true,
+      realname: '未登录'
     }
   },
   mounted() {
     window.addEventListener('scroll', this.handleScroll, true)
+    getUserInfo()
+      .then(res => {
+        this.realname = res.data.realname
+        localStorage.setItem('realname', res.data.realname)
+        localStorage.setItem('username', res.data.username)
+      })
   },
   methods: {
     handleSelect(key, keyPath) {