You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Door/controller/StaticHtmlHandlerController.go

36 lines
639 B
Go

package controller
import (
"flx/mister"
"net/http"
"github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus"
)
func RedirectIndex(c *gin.Context) {
defer func() {
if r := recover(); r != nil {
log.Error("RedirectIndex:", r)
}
}()
log.Println(" page not found 404 try_files *** index.html")
c.Redirect(http.StatusFound, "/hucb/hygl") //首页根路径上下文http://localhost:9998/
return
}
func Index(c *gin.Context) {
defer func() {
if r := recover(); r != nil {
log.Error("Index:", r)
}
}()
c.Header("content-type", "text/html;charset=utf-8")
c.String(http.StatusOK, string(mister.Html))
return
}