Merge pull request #105 from myl7/dev

Fix index page 500 error
This commit is contained in:
Spencer Woo 2021-09-14 09:10:42 +01:00 committed by GitHub
commit 3ca860d7c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,10 +8,11 @@ import { compareHashedToken } from '../../utils/tools'
const basePath = pathPosix.resolve('/', apiConfig.base)
const encodePath = (path: string) => {
const encodedPath = pathPosix.join(basePath, pathPosix.resolve('/', path))
let encodedPath = pathPosix.join(basePath, pathPosix.resolve('/', path))
if (encodedPath === '/' || encodedPath === '') {
return ''
}
encodedPath = encodedPath.replace(/\/$/, '')
return `:${encodeURIComponent(encodedPath)}`
}