feat: 增强前端健壮性并添加刷新功能

- 添加刷新按钮和加载状态指示器
- 改进API请求错误处理和用户反馈
- 优化表单验证和登录逻辑
- 更新后端端口号并处理URL结尾斜杠
- 添加按钮悬停效果和移动端适配
This commit is contained in:
2025-12-23 23:48:12 +08:00
parent af8fdd5f52
commit b49fdeaa9d
7 changed files with 235 additions and 86 deletions

View File

@@ -1,8 +1 @@
[
{
"id": "1766503652493156300",
"name": "MobaXterm_Portable_v25.4",
"fileName": "MobaXterm_Portable_v25.4.zip",
"date": "2025-12-23 23:27:32"
}
]

View File

@@ -31,7 +31,7 @@ var (
appsMutex sync.RWMutex // 读写锁,提高并发性能
filesDir = "./files"
jsonFile = "./apps.json"
port = ":6902"
port = ":6903" // 修改端口号为6903
)
// 生成唯一文件名
@@ -122,6 +122,7 @@ func main() {
api.GET("/apps", getApps)
api.POST("/apps", uploadApp)
api.GET("/apps/:id", downloadApp)
api.GET("/apps/:id/", downloadApp) // 处理以/结尾的URL
}
// 启动服务器
@@ -228,6 +229,6 @@ func downloadApp(c *gin.Context) {
return
}
// 提供文件下载,设置原始文件名
// 使用FileAttachment直接提供文件下载避免重定向
c.FileAttachment(filePath, targetApp.FileName)
}