fix(src): get alias
This commit is contained in:
parent
ce99a04f2e
commit
784173e4c8
1 changed files with 4 additions and 5 deletions
|
|
@ -51,8 +51,6 @@ let cacheRoute = null
|
||||||
let cacheXhr = null
|
let cacheXhr = null
|
||||||
|
|
||||||
const getAlias = function (route) {
|
const getAlias = function (route) {
|
||||||
route = route.replace(/\/+/, '/')
|
|
||||||
|
|
||||||
if (OPTIONS.alias[route]) {
|
if (OPTIONS.alias[route]) {
|
||||||
return getAlias(OPTIONS.alias[route])
|
return getAlias(OPTIONS.alias[route])
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -74,10 +72,11 @@ const mainRender = function (cb) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// replace route
|
// replace route
|
||||||
if (OPTIONS.alias && OPTIONS.alias['/' + route]) {
|
route = '/' + route
|
||||||
route = getAlias('/' + route)
|
if (OPTIONS.alias && OPTIONS.alias[route]) {
|
||||||
|
route = getAlias(route)
|
||||||
} else {
|
} else {
|
||||||
route = OPTIONS.basePath + route
|
route = (OPTIONS.basePath + route).replace(/\/+/, '/')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!route) {
|
if (!route) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue