fix开关ssl失败

This commit is contained in:
zhangchenhao
2025-05-09 10:33:08 +08:00
parent 8c8c5104dc
commit 366904cc31
2 changed files with 51 additions and 3 deletions

View File

@@ -8,7 +8,7 @@ import (
func Register(r *gin.Engine) {
v1 := r.Group("/v1")
login := v1.Group("/login")
{
login.POST("/sign", api.Sign)
@@ -70,11 +70,13 @@ func Register(r *gin.Engine) {
{
overview.POST("/get_overviews", api.GetOverview)
}
// 1. 提供静态文件服务
r.StaticFS("/static", http.Dir("./frontend/static")) // 静态资源路径
r.StaticFS("/auto-deploy/static", http.Dir("./frontend/static")) // 静态资源路径
// icon
r.StaticFS("/favicon.ico", http.Dir("./frontend/favicon.ico")) // favicon.ico
// 3. 前端路由托管:匹配所有其他路由并返回 index.html
r.NoRoute(func(c *gin.Context) {
c.File("./frontend/index.html")