From 963d9e51332d845e8277defde878642dd553bf1b Mon Sep 17 00:00:00 2001 From: quyixiao <2621048238@qq.com> Date: Tue, 25 Aug 2020 16:38:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/index.js | 4 ++-- src/router/index.js | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/config/index.js b/config/index.js index 29525d6..4d9c185 100644 --- a/config/index.js +++ b/config/index.js @@ -13,14 +13,14 @@ module.exports = { assetsPublicPath: '/', proxyTable: { '/lz_management': { - target: 'http://192.168.43.94:8080', + target: 'http://localhost:8080', changeOrigin: true } }, // Various Dev Server settings // host: '192.168.43.94', // can be overwritten by process.env.HOST - host: '192.168.43.94', // can be overwritten by process.env.HOST + //host: '192.168.43.94', // can be overwritten by process.env.HOST port: 8001, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined autoOpenBrowser: true, errorOverlay: true, diff --git a/src/router/index.js b/src/router/index.js index ab55eb7..183ab5c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,9 +8,10 @@ import Vue from 'vue' import Router from 'vue-router' import { apiGetMenuNav } from '@/api/api_menu' import { isURL } from '@/utils/validate' -import { clearLoginInfo } from '@/utils' -import VConsole from 'vconsole'; -let vConsole = new VConsole(); +import {clearLoginInfo} from '@/utils' +import VConsole from 'vconsole' + +let vConsole = new VConsole() Vue.use(Router) // 开发环境不使用懒加载, 因为懒加载页面太多的话会造成webpack热更新太慢, 所以只有生产环境使用懒加载 @@ -71,7 +72,7 @@ const router = new Router({ router.beforeEach((to, from, next) => { // 添加动态(菜单)路由 // 1. 已经添加 or 全局路由, 直接访问 - // 2. 获取菜单列表, 添加并保存本地存储 + // 2. 获取菜单列表, 添加并保存本地存储 if (router.options.isAddDynamicMenuRoutes || fnCurrentRouteType(to, globalRoutes) === 'global') { next() } else { @@ -109,8 +110,8 @@ function fnCurrentRouteType (route, globalRoutes = []) { /** * 判断是否为钉钉打开 - * @param {*} menuList - * @param {*} routes + * @param {*} menuList + * @param {*} routes */ function isDingtalk () { if (/(DingTalk)/i.test(navigator.userAgent)) { @@ -119,6 +120,7 @@ function isDingtalk () { return false } } + /** * 添加动态(菜单)路由 * @param {*} menuList 菜单列表