mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-16 06:11:38 +00:00
Fix: server nuxt client directly without proxy
This commit is contained in:
parent
57994ffb5b
commit
a8b7c56bec
7 changed files with 30 additions and 49 deletions
|
|
@ -33,13 +33,12 @@ export default function rewritePwaManifest () {
|
|||
|
||||
const currentBasePath = manifest.start_url.split('?')[0]
|
||||
|
||||
if (currentBasePath !== routerBasePath) {
|
||||
if (currentBasePath !== (routerBasePath || '/')) {
|
||||
// Rewrite start_url and icons paths
|
||||
manifest.start_url = `${routerBasePath || '/'}${manifest.start_url.slice(currentBasePath.length)}`
|
||||
manifest.start_url = `${routerBasePath}${manifest.start_url.slice(currentBasePath.length)}`
|
||||
for (const icon of manifest.icons) {
|
||||
icon.src = currentBasePath.startsWith('.')
|
||||
? `${routerBasePath}${icon.src}` // Initially, the start_url is `./`
|
||||
: `${routerBasePath}/${icon.src.slice(currentBasePath.length)}`
|
||||
const path = icon.src.startsWith('/') ? icon.src.slice(currentBasePath.length) : icon.src
|
||||
icon.src = `${routerBasePath}${path}`
|
||||
}
|
||||
|
||||
// Update manifest file
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue