fix: 修复assets文件路径拼接错误

- Gin的*filepath参数包含开头的/,需要去除
- 修复路径拼接导致的双斜杠问题
- 移除自动刷新逻辑,这不是正确的解决方案
This commit is contained in:
2026-05-04 16:23:26 +08:00
parent 337ddf6bb4
commit e229e31079
2 changed files with 1 additions and 6 deletions
+1
View File
@@ -264,6 +264,7 @@ func setupEmbeddedFrontend(r *gin.Engine) {
r.GET("/assets/*filepath", func(c *gin.Context) { r.GET("/assets/*filepath", func(c *gin.Context) {
filepath := c.Param("filepath") filepath := c.Param("filepath")
filepath = strings.TrimPrefix(filepath, "/")
decodedPath, err := url.PathUnescape(filepath) decodedPath, err := url.PathUnescape(filepath)
if err != nil { if err != nil {
decodedPath = filepath decodedPath = filepath
-6
View File
@@ -13,12 +13,6 @@ const router = createRouter({
}, },
}) })
router.onError((error) => {
if (error.message.includes('Failed to fetch dynamically imported module')) {
window.location.reload()
}
})
createRouterGuard(router) createRouterGuard(router)
export default router export default router