mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Feat: embed static files
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
"github.com/HFO4/cloudreve/models"
|
||||
"github.com/HFO4/cloudreve/pkg/serializer"
|
||||
"github.com/gin-gonic/gin"
|
||||
"gopkg.in/go-playground/validator.v8"
|
||||
"gopkg.in/go-playground/validator.v9"
|
||||
)
|
||||
|
||||
// ParamErrorMsg 根据Validator返回的错误信息给出错误提示
|
||||
@@ -41,7 +41,7 @@ func ErrorResponse(err error) serializer.Response {
|
||||
if ve, ok := err.(validator.ValidationErrors); ok {
|
||||
for _, e := range ve {
|
||||
return serializer.ParamErr(
|
||||
ParamErrorMsg(e.Field, e.Tag),
|
||||
ParamErrorMsg(e.Field(), e.Tag()),
|
||||
err,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/HFO4/cloudreve/pkg/util"
|
||||
"github.com/HFO4/cloudreve/routers/controllers"
|
||||
"github.com/gin-contrib/cors"
|
||||
"github.com/gin-contrib/static"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@@ -78,6 +79,7 @@ func InitMasterRouter() *gin.Engine {
|
||||
/*
|
||||
静态资源
|
||||
*/
|
||||
r.Use(static.Serve("/", bootstrap.StaticFS))
|
||||
r.GET("manifest.json", controllers.Manifest)
|
||||
|
||||
v3 := r.Group("/api/v3")
|
||||
|
||||
Reference in New Issue
Block a user