fix index page 500 error

By removing trailing slash for drive api
This commit is contained in:
myl7
2021-09-10 04:48:41 +08:00
parent e53716eb12
commit f3d1b01ccb
+2 -1
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)}`
}