diff --git a/server/initialize/router.go b/server/initialize/router.go index 1020ae3630..595ef927bc 100644 --- a/server/initialize/router.go +++ b/server/initialize/router.go @@ -15,7 +15,13 @@ import ( // 初始化总路由 func Routers() *gin.Engine { - Router := gin.Default() + + // 设置为发布模式 + if global.GVA_CONFIG.System.Env == "public" { + gin.SetMode(gin.ReleaseMode) //DebugMode ReleaseMode TestMode + } + Router := gin.New() + InstallPlugin(Router) // 安装插件 systemRouter := router.RouterGroupApp.System exampleRouter := router.RouterGroupApp.Example diff --git a/server/resource/autocode_template/server/model.go.tpl b/server/resource/autocode_template/server/model.go.tpl index abd68bf5fa..de2a687cac 100644 --- a/server/resource/autocode_template/server/model.go.tpl +++ b/server/resource/autocode_template/server/model.go.tpl @@ -14,7 +14,9 @@ type {{.StructName}} struct { {{.FieldName}} string `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};type:enum({{.DataTypeLong}});comment:{{.Comment}};"` {{- else if eq .FieldType "picture" }} {{.FieldName}} string `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}"` - {{- else if eq .FieldType "file" }} + {{- else if eq .FieldType "video" }} + {{.FieldName}} string `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}"` + {{- else if eq .FieldType "file" }} {{.FieldName}} datatypes.JSON `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}"` {{- else if eq .FieldType "pictures" }} {{.FieldName}} datatypes.JSON `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}"` diff --git a/server/resource/autocode_template/web/form.vue.tpl b/server/resource/autocode_template/web/form.vue.tpl index 6af7713305..b280a231e9 100644 --- a/server/resource/autocode_template/web/form.vue.tpl +++ b/server/resource/autocode_template/web/form.vue.tpl @@ -34,10 +34,13 @@ {{- end }} {{- if eq .FieldType "picture" }} - + + {{- end }} + {{- if eq .FieldType "video" }} + {{- end }} {{- if eq .FieldType "pictures" }} - + {{- end }} {{- if eq .FieldType "file" }} @@ -108,6 +111,9 @@ const formData = ref({ {{- if eq .FieldType "picture" }} {{.FieldJson}}: "", {{- end }} + {{- if eq .FieldType "video" }} + {{.FieldJson}}: "", + {{- end }} {{- if eq .FieldType "pictures" }} {{.FieldJson}}: [], {{- end }} diff --git a/server/resource/autocode_template/web/table.vue.tpl b/server/resource/autocode_template/web/table.vue.tpl index 0a344d9275..0e0912a9b5 100644 --- a/server/resource/autocode_template/web/table.vue.tpl +++ b/server/resource/autocode_template/web/table.vue.tpl @@ -139,6 +139,18 @@ + {{- else if eq .FieldType "video" }} + + + {{- else if eq .FieldType "richtext" }}