jinx 4 лет назад
Родитель
Сommit
f25f3a9fad
7 измененных файлов с 1172 добавлено и 662 удалено
  1. 16 17
      config/index.js
  2. 1 0
      package.json
  3. 338 0
      src/pages/bindAccount/index.vue
  4. 0 0
      src/pages/bindAccount/style.scss
  5. 587 462
      src/pages/home/index.vue
  6. 169 133
      src/pages/layout/aside.vue
  7. 61 50
      src/router/index.js

+ 16 - 17
config/index.js

@@ -1,30 +1,29 @@
-'use strict'
+"use strict";
 // Template version: 1.3.1
 // see http://vuejs-templates.github.io/webpack for documentation.
 
-const path = require('path')
+const path = require("path");
 
 module.exports = {
   dev: {
-
     // Paths
-    assetsSubDirectory: 'static',
-    assetsPublicPath: '/',
+    assetsSubDirectory: "static",
+    assetsPublicPath: "/",
     proxyTable: {
-      '/api': {
+      "/api": {
         //target: 'http://192.168.0.47:7081', // 接口的域名
-        target: 'https://cszfb.4dkankan.com/zfb', // 接口的域名
+        target: "https://cszfb.4dkankan.com/zfb", // 接口的域名
         // target: 'http://192.168.0.143:7081', // 接口的域名
         // secure: false,  // 如果是https接口,需要配置这个参数
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
         pathRewrite: {
-          '^/api': ''
+          "^/api": ""
         }
       }
     },
 
     // Various Dev Server settings
-    host: '0.0.0.0', // can be overwritten by process.env.HOST
+    host: "0.0.0.0", // can be overwritten by process.env.HOST
     port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
     autoOpenBrowser: false,
     errorOverlay: true,
@@ -44,7 +43,7 @@ module.exports = {
      */
 
     // https://webpack.js.org/configuration/devtool/#development
-    devtool: 'cheap-module-eval-source-map',
+    devtool: "cheap-module-eval-source-map",
 
     // If you have problems debugging vue-files in devtools,
     // set this to false - it *may* help
@@ -56,12 +55,12 @@ module.exports = {
 
   build: {
     // Template for index.html
-    index: path.resolve(__dirname, '../dist/index.html'),
+    index: path.resolve(__dirname, "../dist/index.html"),
 
     // Paths
-    assetsRoot: path.resolve(__dirname, '../dist'),
-    assetsSubDirectory: 'static',
-    assetsPublicPath: './',
+    assetsRoot: path.resolve(__dirname, "../dist"),
+    assetsSubDirectory: "static",
+    assetsPublicPath: "./",
 
     /**
      * Source Maps
@@ -69,14 +68,14 @@ module.exports = {
 
     productionSourceMap: false,
     // https://webpack.js.org/configuration/devtool/#production
-    devtool: '#source-map',
+    devtool: "#source-map",
 
     // Gzip off by default as many popular static hosts such as
     // Surge or Netlify already gzip all static assets for you.
     // Before setting to `true`, make sure to:
     // npm install --save-dev compression-webpack-plugin
     productionGzip: false,
-    productionGzipExtensions: ['js', 'css'],
+    productionGzipExtensions: ["js", "css"],
 
     // Run the build command with an extra argument to
     // View the bundle analyzer report after build finishes:
@@ -84,4 +83,4 @@ module.exports = {
     // Set to `true` or `false` to always turn it on or off
     bundleAnalyzerReport: process.env.npm_config_report
   }
-}
+};

+ 1 - 0
package.json

@@ -13,6 +13,7 @@
   "dependencies": {
     "axios": "^0.18.0",
     "element-ui": "^2.4.11",
+    "js-base64": "^3.7.2",
     "quill-image-drop-module": "^1.0.3",
     "quill-image-resize-module": "^3.0.0",
     "vue": "^2.5.2",

+ 338 - 0
src/pages/bindAccount/index.vue

@@ -0,0 +1,338 @@
+<template>
+  <div id="bindAccount"
+       v-loading.fullscreen.lock="!loading">
+    <div v-if="loading"
+         class="h-body">
+      <div v-if="info.fdkkUser"
+           class="bindBox formBox">
+        <el-form label-width="80px">
+          <el-form-item label="手机号码">
+            <el-input disabled
+                      v-model="show_fdkkUser"></el-input>
+          </el-form-item>
+        </el-form>
+        <span class="unBond"
+              @click="unBind">解绑账号</span>
+      </div>
+      <div v-else
+           class="formBox">
+        <el-form ref="ruleForm"
+                 :rules="rules"
+                 :model="form"
+                 label-width="80px">
+          <el-form-item label="手机号码"
+                        prop="fdkkUser">
+            <el-input v-model="form.fdkkUser"
+                      placeholder="请输入手机号码"></el-input>
+          </el-form-item>
+          <el-form-item label="密码"
+                        prop="fdkkPassword">
+            <el-input v-model="form.fdkkPassword"
+                      placeholder="请输入密码"></el-input>
+          </el-form-item>
+        </el-form>
+      </div>
+      <div class="text">
+        <p>温馨提示:</p>
+        <p>1、绑定的账号是四维看看pro相机的账号信息。</p>
+        <p>2、绑定后,编辑该相机拍摄的场景可进行自动登录,不需要重复登录。</p>
+
+      </div>
+
+      <div v-if="!info.fdkkUser"
+           class="btn">
+        <el-button type="warning"
+                   @click="handleReset('ruleForm')">重置</el-button>
+        <el-button type="primary"
+                   @click="handleSubmit('ruleForm')">提交</el-button>
+      </div>
+
+    </div>
+
+  </div>
+</template>
+
+<script>
+const validatePhoneCheck = async function (rule, value, callback) {
+  if (value === '' || !value) {
+    callback(new Error('手机号不能为空'))
+  } else if (!/^1[3456789]\d{9}$/.test(value)) {
+    callback(new Error('手机号不正确'))
+  } else {
+    callback()
+  }
+}
+
+const handleSubmitValidate = function (vue, name, callback) {
+  vue.$refs[name].validate(function (valid) {
+    if (valid) {
+      callback()
+    } else {
+      vue.$message({
+        type: 'error',
+        message: '请填写完整信息!',
+      })
+      // iview.Message.error('请填写完整信息!')
+      return false
+    }
+  })
+}
+const encodeStr = function (str, strv = '') {
+  const NUM = 2
+  const front = randomWord(false, 8)
+  const middle = randomWord(false, 8)
+  const end = randomWord(false, 8)
+
+  let str1 = str.substring(0, NUM)
+  let str2 = str.substring(NUM)
+
+  if (strv) {
+    let strv1 = strv.substring(0, NUM)
+    let strv2 = strv.substring(NUM)
+    return [
+      front + str2 + middle + str1 + end,
+      front + strv2 + middle + strv1 + end,
+    ]
+  }
+
+  return front + str2 + middle + str1 + end
+}
+const randomWord = function (randomFlag, min, max) {
+  let str = ''
+  let range = min
+  let arr = [
+    '0',
+    '1',
+    '2',
+    '3',
+    '4',
+    '5',
+    '6',
+    '7',
+    '8',
+    '9',
+    'a',
+    'b',
+    'c',
+    'd',
+    'e',
+    'f',
+    'g',
+    'h',
+    'i',
+    'j',
+    'k',
+    'l',
+    'm',
+    'n',
+    'o',
+    'p',
+    'q',
+    'r',
+    's',
+    't',
+    'u',
+    'v',
+    'w',
+    'x',
+    'y',
+    'z',
+    'A',
+    'B',
+    'C',
+    'D',
+    'E',
+    'F',
+    'G',
+    'H',
+    'I',
+    'J',
+    'K',
+    'L',
+    'M',
+    'N',
+    'O',
+    'P',
+    'Q',
+    'R',
+    'S',
+    'T',
+    'U',
+    'V',
+    'W',
+    'X',
+    'Y',
+    'Z',
+  ]
+  // 随机产生
+  if (randomFlag) {
+    range = Math.round(Math.random() * (max - min)) + min
+  }
+  for (var i = 0; i < range; i++) {
+    let pos = Math.round(Math.random() * (arr.length - 1))
+    str += arr[pos]
+  }
+  return str
+}
+import { Base64 } from 'js-base64'
+export default {
+  data() {
+    return {
+      loading: false,
+      show_fdkkUser: null,
+      info: {
+        fdkkUser: null,
+      },
+      form: {
+        fdkkUser: '',
+        fdkkPassword: '',
+      },
+      rules: {
+        fdkkUser: [
+          {
+            required: true,
+            validator: validatePhoneCheck,
+            trigger: 'blur',
+          },
+        ],
+        fdkkPassword: [
+          { required: true, message: '密码不能为空', trigger: 'blur' },
+        ],
+      },
+    }
+  },
+  watch: {},
+  created() {
+    this.getBindInfo()
+  },
+  methods: {
+    handleSubmit(name) {
+      handleSubmitValidate(this, name, () => {
+        var data = {
+          // fdkkPassword: encodeStr(Base64.encode(this.form.fdkkPassword)),
+          fdkkPassword: this.form.fdkkPassword,
+          fdkkUser: this.form.fdkkUser,
+        }
+        this.$http({
+          method: 'post',
+          url: 'user/bind4dkkUser',
+          data: data,
+          headers: {
+            token: window.localStorage.getItem('zfb_token'),
+          },
+        })
+          .then((res) => {
+            console.log(res)
+            if (res.code == 200) {
+              this.$message({
+                type: 'success',
+                message: '绑定成功!',
+              })
+              this.getBindInfo()
+              this.form = {
+                fdkkUser: '',
+                fdkkPassword: '',
+              }
+            }
+          })
+          .catch((err) => {})
+      })
+    },
+    handleReset(name) {
+      this.$refs[name].resetFields()
+      this.form = {
+        fdkkUser: '',
+        fdkkPassword: '',
+      }
+    },
+    getBindInfo() {
+      // var userId = JSON.parse(localStorage.getItem('userInfo')).userId || 1
+      var userId = 1
+
+      this.$http({
+        method: 'post',
+        url: `/user/getInfo`,
+        // data: params,
+        headers: {
+          token: window.localStorage.getItem('zfb_token'),
+        },
+      })
+        .then((res) => {
+          console.log(res)
+          this.loading = true
+          this.info = res.message
+          if (res.message.fdkkUser) {
+            this.show_fdkkUser =
+              res.message.fdkkUser.substring(0, 4) +
+              '****' +
+              res.message.fdkkUser.substring(8, res.message.fdkkUser.length - 1)
+          }
+        })
+        .catch((err) => {
+          this.loading = true
+        })
+    },
+    unBind() {
+      this.$confirm(
+        '解绑后,编辑当前账号下的八目相机需进行手动登录,是否确定解绑?',
+        '提示'
+      )
+        .then(() => {
+          this.$http({
+            method: 'post',
+            url: 'user/unBind4dkkUser',
+            data: { fdkkUser: this.info.fdkkUser },
+            headers: {
+              token: window.localStorage.getItem('zfb_token'),
+            },
+          }).then((res) => {
+            this.info.fdkkUser = null
+            this.$message({
+              type: 'success',
+              message: '解绑成功!',
+            })
+          })
+        })
+        .catch((_) => {})
+    },
+  },
+}
+</script>
+
+<style lang="scss">
+#bindAccount {
+  .h-body {
+    width: 100%;
+    margin: 30px 0 0;
+    padding: 20px;
+    -webkit-box-shadow: 0 0 12px 0 rgba(0, 0, 0, 0.1);
+    box-shadow: 0 0 12px 0 rgba(0, 0, 0, 0.1);
+    border-radius: 3px;
+    background-color: #fff;
+    box-sizing: border-box;
+    .text {
+      color: #666;
+      font-size: 14px;
+      line-height: 30px;
+      padding: 20px;
+      box-sizing: border-box;
+    }
+    .btn {
+      padding: 20px;
+      box-sizing: border-box;
+    }
+    .formBox {
+      width: 600px;
+      position: relative;
+      .unBond {
+        position: absolute;
+        color: #02a7f0;
+        top: 50%;
+        right: -65px;
+        transform: translateY(-50%);
+        cursor: pointer;
+      }
+    }
+  }
+}
+</style>

+ 0 - 0
src/pages/bindAccount/style.scss


Разница между файлами не показана из-за своего большого размера
+ 587 - 462
src/pages/home/index.vue


+ 169 - 133
src/pages/layout/aside.vue

@@ -1,123 +1,161 @@
 <template>
-<div class='aside'>
-  <div class="nav-menu">
-    <div class="navigator_menu">
-      <vcenter>
-        <span>导航面板</span>
-      </vcenter>
-    </div>
-    <ul class="aside-ul" v-if="roleType == -1">
-      <li class="aside-li" v-for="(item,i) in aside" :key="i">
-        <div @click="clickNav(item)" :class="{'aside-li-div':true,'active':item.id&&item.id===activeIdx}" >
-          <vcenter>
-            <i class="iconfont" :class="item.icon" style="float:left;width:27px;"></i>
-            <span style="vertical-align: middle;">{{item.name}}</span>
-            <i v-if="item.subItem" style="font-size:12px;vertical-align: middle;position:relative;top:2px;" :class="{'iconfont':true, 'icon-arrow':true,'fr':true,rotate:item.isShow}"></i>
-          </vcenter>
-        </div>
-        <ul class="li-ul" v-if="item.subItem" :style="{maxHeight:item.isShow?'180px':'0'}">
-          <li @click="navigate(sub)" v-for="(sub, idx) in item.subItem" :class="{'active':sub.id&&sub.id===activeIdx}" :key="idx">
+  <div class='aside'>
+    <div class="nav-menu">
+      <div class="navigator_menu">
+        <vcenter>
+          <span>导航面板</span>
+        </vcenter>
+      </div>
+      <ul class="aside-ul"
+          v-if="roleType == -1">
+        <li class="aside-li"
+            v-for="(item,i) in aside"
+            :key="i">
+          <div @click="clickNav(item)"
+               :class="{'aside-li-div':true,'active':item.id&&item.id===activeIdx}">
+            <vcenter>
+              <i class="iconfont"
+                 :class="item.icon"
+                 style="float:left;width:27px;"></i>
+              <span style="vertical-align: middle;">{{item.name}}</span>
+              <i v-if="item.subItem"
+                 style="font-size:12px;vertical-align: middle;position:relative;top:2px;"
+                 :class="{'iconfont':true, 'icon-arrow':true,'fr':true,rotate:item.isShow}"></i>
+            </vcenter>
+          </div>
+          <ul class="li-ul"
+              v-if="item.subItem"
+              :style="{maxHeight:item.isShow?'180px':'0'}">
+            <li @click="navigate(sub)"
+                v-for="(sub, idx) in item.subItem"
+                :class="{'active':sub.id&&sub.id===activeIdx}"
+                :key="idx">
+              <vcenter>
+                <span>{{sub.name}}</span>
+                <span v-if="sub.id==='1-2' && a_tips"
+                      class="aside-tip">{{a_tips}}</span>
+              </vcenter>
+            </li>
+          </ul>
+        </li>
+      </ul>
+      <ul class="aside-ul"
+          v-if=" roleType != -1">
+        <li class="aside-li">
+          <div class="aside-li-div">
             <vcenter>
-              <span>{{sub.name}}</span>
-              <span v-if="sub.id==='1-2' && a_tips" class="aside-tip">{{a_tips}}</span>
+              <i class="el-icon-tickets"
+                 style="float:left;width:27px;"></i>
+              <span style="vertical-align: middle;">场景管理</span>
             </vcenter>
-          </li>
-        </ul>
-      </li>
-    </ul>
-    <ul class="aside-ul" v-if=" roleType != -1">
-      <li class="aside-li">
-        <div class="aside-li-div">
-          <vcenter>
-            <i class="el-icon-tickets" style="float:left;width:27px;"></i>
-            <span style="vertical-align: middle;">场景管理</span>
-          </vcenter>
-        </div>
-      </li>
-    </ul>
+          </div>
+        </li>
+      </ul>
+    </div>
   </div>
-</div>
 </template>
 
 <script>
 import vcenter from '@/components/vcenter'
 
-const aside = [{
-  name: '企业管理',
-  id: '',
-  icon: 'icon-renzheng',
-  isShow: true,
-  subItem: [{
-    name: '企业账号',
-    id: '1-1',
-    url: '/home'
-  }, {
-    name: '企业认证',
-    id: '1-2',
-    url: '/authentication'
-  }]
-}, {
-  name: '信息发布',
-  id: '',
-  icon: 'icon-xinxifabu',
-  isShow: false,
-  subItem: [{
-    name: '出租信息',
-    id: '2-1',
-    url: '/rental-info'
-  }, {
-    name: '出售信息',
-    id: '2-2',
-    url: '/sell-info'
-  }, {
-    name: '工地装修',
-    id: '2-3',
-    url: '/site-decoration'
-  }]
-}, {
-  name: '广告位',
-  id: '',
-  icon: 'icon-guanggao',
-  isShow: false,
-  subItem: [{
-    name: '轮播图',
-    id: '3-1',
-    url: '/z-carousel'
-  }, {
-    name: '推荐位',
-    id: '3-2',
-    url: '/recommended'
-  }]
-}, {
-  name: '场景下载',
-  id: '4',
-  icon: 'icon-xinxifabu',
-  url: '/download',
-  isShow: false
-},{
-  name:'设备管理',
-  id:'5',
-  icon:'icon-xinxifabu',
-  url:'/equipment',
-  isShow:false
-},
-{
-  name:'场景管理',
-  id:'6',
-  icon:'icon-guanggao',
-  url:'/scene',
-  isShow: false
-}]
+const aside = [
+  {
+    name: '企业管理',
+    id: '',
+    icon: 'icon-renzheng',
+    isShow: true,
+    subItem: [
+      {
+        name: '企业账号',
+        id: '1-1',
+        url: '/home',
+      },
+      {
+        name: '企业认证',
+        id: '1-2',
+        url: '/authentication',
+      },
+    ],
+  },
+  {
+    name: '信息发布',
+    id: '',
+    icon: 'icon-xinxifabu',
+    isShow: false,
+    subItem: [
+      {
+        name: '出租信息',
+        id: '2-1',
+        url: '/rental-info',
+      },
+      {
+        name: '出售信息',
+        id: '2-2',
+        url: '/sell-info',
+      },
+      {
+        name: '工地装修',
+        id: '2-3',
+        url: '/site-decoration',
+      },
+    ],
+  },
+  {
+    name: '广告位',
+    id: '',
+    icon: 'icon-guanggao',
+    isShow: false,
+    subItem: [
+      {
+        name: '轮播图',
+        id: '3-1',
+        url: '/z-carousel',
+      },
+      {
+        name: '推荐位',
+        id: '3-2',
+        url: '/recommended',
+      },
+    ],
+  },
+  {
+    name: '场景下载',
+    id: '4',
+    icon: 'icon-xinxifabu',
+    url: '/download',
+    isShow: false,
+  },
+  {
+    name: '设备管理',
+    id: '5',
+    icon: 'icon-xinxifabu',
+    url: '/equipment',
+    isShow: false,
+  },
+  {
+    name: '场景管理',
+    id: '6',
+    icon: 'icon-guanggao',
+    url: '/scene',
+    isShow: false,
+  },
+  {
+    name: '绑定账号',
+    id: '7',
+    icon: 'icon-guanggao',
+    url: '/bindAccount',
+    isShow: false,
+  },
+]
 export default {
-
   name: 'm-aside',
-  components: {vcenter},
+  components: { vcenter },
 
-  data () {
+  data() {
     return {
       aside,
       a_tips: 0,
-      roleType: window.localStorage.getItem('zfb_roleType')
+      roleType: window.localStorage.getItem('zfb_roleType'),
     }
   },
   computed: {
@@ -125,15 +163,14 @@ export default {
       get: function () {
         return this.$route.meta.index
       },
-      set: function () {
-      }
+      set: function () {},
     },
-    token () {
+    token() {
       return window.localStorage.getItem('zfb_token')
-    }
+    },
   },
-  mounted () {
-    this.$bus.$on('refresh', data => {
+  mounted() {
+    this.$bus.$on('refresh', (data) => {
       if (data) {
         this._getTipsNum()
       }
@@ -141,7 +178,7 @@ export default {
     this._getTipsNum()
   },
   methods: {
-    clickNav (item) {
+    clickNav(item) {
       if (item.id) {
         this.activeIdx = item.id
         item.url && this.$router.push(item.url)
@@ -149,70 +186,70 @@ export default {
         item.isShow = !item.isShow
       }
     },
-    navigate (item) {
+    navigate(item) {
       this._getTipsNum()
       this.activeIdx = item.id
       this.$router.push(item.url)
     },
-    async _getTipsNum () {
+    async _getTipsNum() {
       let result = await this.$http({
         method: 'post',
         url: '/company/selectAuditNum',
         headers: {
-          token: this.token
-        }
+          token: this.token,
+        },
       })
       this.a_tips = result.message
-    }
-  }
+    },
+  },
 }
 </script>
 
 <style lang="scss" scoped>
 .aside {
   width: 100%;
-  .navigator_menu{
+  .navigator_menu {
     height: 56px;
-    span{
+    span {
       padding-left: 20px;
       font-size: 12px;
       color: #999;
     }
   }
-  .aside-ul{
+  .aside-ul {
     color: #999;
-    .aside-li{
+    .aside-li {
       cursor: pointer;
       font-size: 14px;
-      .aside-li-div{
+      .aside-li-div {
         padding: 0 20px;
         height: 56px;
-        .fr{
+        .fr {
           float: right;
           transition: transform 0.3s ease;
         }
-        .rotate{
+        .rotate {
           transform: rotate(180deg);
         }
-        &:hover{
+        &:hover {
           background-color: #f5f5f5;
         }
       }
-      .active{
+      .active {
         background-color: #f5f5f5;
         color: #333;
-        .iconfont{
+        .iconfont {
           color: #333;
         }
       }
-      .li-ul{
+      .li-ul {
         max-height: 180px;
         transition: max-height 0.3s ease;
         overflow: hidden;
-        li{
+        li {
           height: 56px;
           padding: 0 47px;
-          .aside-tip{
+          .aside-tip {
             background: #ff0000;
             color: #fff;
             border-radius: 10px;
@@ -224,7 +261,7 @@ export default {
             line-height: 16px;
             margin-left: 4px;
           }
-          &:hover{
+          &:hover {
             background-color: #f5f5f5;
           }
         }
@@ -232,5 +269,4 @@ export default {
     }
   }
 }
-
 </style>

+ 61 - 50
src/router/index.js

@@ -1,66 +1,66 @@
-import Vue from 'vue'
-import Router from 'vue-router'
-Vue.use(Router)
+import Vue from "vue";
+import Router from "vue-router";
+Vue.use(Router);
 
 const router = new Router({
   routes: [
     {
-      path: '/',
-      component: () => import('@/pages/layout/'),
+      path: "/",
+      component: () => import("@/pages/layout/"),
       children: [
         {
-          path: '/home',
-          name: '企业账号',
-          component: () => import('@/pages/home'),
-          meta: {index: '1-1'}
+          path: "/home",
+          name: "企业账号",
+          component: () => import("@/pages/home"),
+          meta: { index: "1-1" }
         },
         {
-          path: '/authentication',
-          name: '企业认证',
-          component: () => import('@/pages/authentication'),
-          meta: {index: '1-2'}
+          path: "/authentication",
+          name: "企业认证",
+          component: () => import("@/pages/authentication"),
+          meta: { index: "1-2" }
         },
         {
-          path: '/rental-info',
-          name: '出租信息',
-          component: () => import('@/pages/rental-info'),
-          meta: {index: '2-1'}
+          path: "/rental-info",
+          name: "出租信息",
+          component: () => import("@/pages/rental-info"),
+          meta: { index: "2-1" }
         },
         {
-          path: '/sell-info',
-          name: '出售信息',
-          component: () => import('@/pages/sell-info'),
-          meta: {index: '2-2'}
+          path: "/sell-info",
+          name: "出售信息",
+          component: () => import("@/pages/sell-info"),
+          meta: { index: "2-2" }
         },
         {
-          path: '/site-decoration',
-          name: '工地装修',
-          component: () => import('@/pages/site-decoration'),
-          meta: {index: '2-3'}
+          path: "/site-decoration",
+          name: "工地装修",
+          component: () => import("@/pages/site-decoration"),
+          meta: { index: "2-3" }
         },
         {
-          path: '/z-carousel',
-          name: '轮播图',
-          component: () => import('@/pages/z-carousel'),
-          meta: {index: '3-1'}
+          path: "/z-carousel",
+          name: "轮播图",
+          component: () => import("@/pages/z-carousel"),
+          meta: { index: "3-1" }
         },
         {
-          path: '/recommended',
-          name: '推荐位',
-          component: () => import('@/pages/recommended'),
-          meta: {index: '3-2'}
+          path: "/recommended",
+          name: "推荐位",
+          component: () => import("@/pages/recommended"),
+          meta: { index: "3-2" }
         },
         {
-          path: '/download',
-          name: '场景下载',
-          component: () => import('@/pages/download'),
-          meta: {index: '4'}
+          path: "/download",
+          name: "场景下载",
+          component: () => import("@/pages/download"),
+          meta: { index: "4" }
         },
         {
-          path:'/equipment',
-          name:'设备管理',
-          component:() => import('@/pages/equipment'),
-          meta:{index: '5'}
+          path: "/equipment",
+          name: "设备管理",
+          component: () => import("@/pages/equipment"),
+          meta: { index: "5" }
         },
         // {
         //   path: '/device',
@@ -69,19 +69,30 @@ const router = new Router({
         //   meta: {index: '5'}
         // },
         {
-          path:'/scene',
-          name:'场景管理',
-          component:()=>import('@/pages/scene'),
-          meta:{index:'6'}
+          path: "/scene",
+          name: "场景管理",
+          component: () => import("@/pages/scene"),
+          meta: { index: "6" }
+        },
+        {
+          path: "/bindAccount",
+          name: "绑定账号",
+          component: () => import("@/pages/bindAccount"),
+          meta: { index: "7" }
         }
       ]
     },
     {
-      path: '/login',
-      name: '登录',
-      component: () => import('@/pages/login')
+      path: "/login",
+      name: "登录",
+      component: () => import("@/pages/login")
     }
   ]
-})
+});
+
+const originalPush = Router.prototype.push;
+Router.prototype.push = function push(location) {
+  return originalPush.call(this, location).catch(err => err);
+};
 
-export default router
+export default router;