From c007fe5fd664ccaa4bed5e42fdd7d2e9a9b0f79e Mon Sep 17 00:00:00 2001 From: toesbieya <1647775459@qq.com> Date: Tue, 30 Jun 2020 16:27:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=87=E6=A1=A3=E9=93=BE?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vue/src/router/constant/index.js | 5 +++++ vue/src/store/modules/resource.js | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/vue/src/router/constant/index.js b/vue/src/router/constant/index.js index 0e217cf..7d9cf42 100644 --- a/vue/src/router/constant/index.js +++ b/vue/src/router/constant/index.js @@ -28,6 +28,11 @@ const routes = [ } ] }, + { + path: 'https://doc.toesbieya.cn', + sort: 1, + meta: {title: '文档', icon: 'documentation'} + }, { path: '/user', component: Layout, diff --git a/vue/src/store/modules/resource.js b/vue/src/store/modules/resource.js index 36a7f9a..5629254 100644 --- a/vue/src/store/modules/resource.js +++ b/vue/src/store/modules/resource.js @@ -5,6 +5,7 @@ import {needAuth} from "@/utils/auth" import {createTree} from "@/utils/tree" import {getAllResources} from "@/api/system/resource" import {isEmpty} from "@/utils" +import {isExternal} from "@/utils/validate" const finalConstantRoutes = transformOriginRoutes(constantRoutes) const finalAuthorityRoutes = transformOriginRoutes(authorityRoutes) @@ -106,7 +107,7 @@ function clean(routes, cleanHidden = true) { function addFullPath(routes, basePath = '/') { routes.forEach(route => { delete route.components - route.fullPath = path.resolve(basePath, route.path) + route.fullPath = isExternal(route.path) ? route.path : path.resolve(basePath, route.path) route.children && addFullPath(route.children, route.fullPath) }) }