From d5f8752ce5ea0eb21209c0c400e5e9f7b6bc77cb Mon Sep 17 00:00:00 2001 From: Johnny Silverhand Date: Tue, 2 Feb 2021 03:12:23 +0300 Subject: [PATCH 1/3] Update router.js with proper subpaths --- src/router.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/router.js b/src/router.js index 84fa437..25ba912 100644 --- a/src/router.js +++ b/src/router.js @@ -28,12 +28,12 @@ const routes = [ } }, { - path: '/tracklist/:type/:id', + path: window.location.pathname + 'tracklist/:type/:id', name: 'Tracklist', component: Tracklist }, { - path: '/artist/:id', + path: window.location.pathname + 'artist/:id', name: 'Artist', component: Artist, meta: { @@ -41,22 +41,22 @@ const routes = [ } }, { - path: '/album/:id', + path: window.location.pathname + 'album/:id', name: 'Album', component: Tracklist }, { - path: '/playlist/:id', + path: window.location.pathname + 'playlist/:id', name: 'Playlist', component: Tracklist }, { - path: '/spotify-playlist/:id', + path: window.location.pathname + 'spotify-playlist/:id', name: 'Spotify Playlist', component: Tracklist }, { - path: '/charts', + path: window.location.pathname + 'charts', name: 'Charts', component: Charts, meta: { @@ -64,7 +64,7 @@ const routes = [ } }, { - path: '/favorites', + path: window.location.pathname + 'favorites', name: 'Favorites', component: Favorites, meta: { @@ -72,37 +72,37 @@ const routes = [ } }, { - path: '/errors', + path: window.location.pathname + 'errors', name: 'Errors', component: Errors }, { - path: '/link-analyzer', + path: window.location.pathname + 'link-analyzer', name: 'Link Analyzer', component: LinkAnalyzer }, { - path: '/about', + path: window.location.pathname + 'about', name: 'About', component: About }, { - path: '/info-arl', + path: window.location.pathname + 'info-arl', name: 'ARL', component: InfoArl }, { - path: '/info-spotify', + path: window.location.pathname + 'info-spotify', name: 'Spotify Features', component: InfoSpotifyFeatures }, { - path: '/settings', + path: window.location.pathname + 'settings', name: 'Settings', component: Settings }, { - path: '/search', + path: window.location.pathname + 'search', name: 'Search', component: Search, meta: { -- GitLab From 7f11fa6306f483ca3dacdbb97efeeccad032b05f Mon Sep 17 00:00:00 2001 From: Johnny Silverhand Date: Tue, 2 Feb 2021 09:53:18 -0500 Subject: [PATCH 2/3] Revert "Update router.js with proper subpaths" This reverts commit d5f8752ce5ea0eb21209c0c400e5e9f7b6bc77cb. --- src/router.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/router.js b/src/router.js index 25ba912..84fa437 100644 --- a/src/router.js +++ b/src/router.js @@ -28,12 +28,12 @@ const routes = [ } }, { - path: window.location.pathname + 'tracklist/:type/:id', + path: '/tracklist/:type/:id', name: 'Tracklist', component: Tracklist }, { - path: window.location.pathname + 'artist/:id', + path: '/artist/:id', name: 'Artist', component: Artist, meta: { @@ -41,22 +41,22 @@ const routes = [ } }, { - path: window.location.pathname + 'album/:id', + path: '/album/:id', name: 'Album', component: Tracklist }, { - path: window.location.pathname + 'playlist/:id', + path: '/playlist/:id', name: 'Playlist', component: Tracklist }, { - path: window.location.pathname + 'spotify-playlist/:id', + path: '/spotify-playlist/:id', name: 'Spotify Playlist', component: Tracklist }, { - path: window.location.pathname + 'charts', + path: '/charts', name: 'Charts', component: Charts, meta: { @@ -64,7 +64,7 @@ const routes = [ } }, { - path: window.location.pathname + 'favorites', + path: '/favorites', name: 'Favorites', component: Favorites, meta: { @@ -72,37 +72,37 @@ const routes = [ } }, { - path: window.location.pathname + 'errors', + path: '/errors', name: 'Errors', component: Errors }, { - path: window.location.pathname + 'link-analyzer', + path: '/link-analyzer', name: 'Link Analyzer', component: LinkAnalyzer }, { - path: window.location.pathname + 'about', + path: '/about', name: 'About', component: About }, { - path: window.location.pathname + 'info-arl', + path: '/info-arl', name: 'ARL', component: InfoArl }, { - path: window.location.pathname + 'info-spotify', + path: '/info-spotify', name: 'Spotify Features', component: InfoSpotifyFeatures }, { - path: window.location.pathname + 'settings', + path: '/settings', name: 'Settings', component: Settings }, { - path: window.location.pathname + 'search', + path: '/search', name: 'Search', component: Search, meta: { -- GitLab From 53ef0304ab9a76b15208feff49481b57ac9aa17d Mon Sep 17 00:00:00 2001 From: Johnny Silverhand Date: Tue, 2 Feb 2021 09:54:35 -0500 Subject: [PATCH 3/3] Set the base path using VueRouter --- src/router.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/router.js b/src/router.js index 84fa437..e053ad4 100644 --- a/src/router.js +++ b/src/router.js @@ -20,7 +20,7 @@ Vue.use(VueRouter) const routes = [ { - path: window.location.pathname, + path: '/', name: 'Home', component: Home, meta: { @@ -118,6 +118,7 @@ const routes = [ const router = new VueRouter({ mode: 'history', + base: window.location.pathname, routes, scrollBehavior(to, from, savedPosition) { return { x: 0, y: 0 } -- GitLab