v2.5.1 beta2 (#1048)

* 修复日志中间件报文过大的报错问题

* 修复 Token 失效后导致的白屏问题

* 增加自动创建插件模板功能

* 密码加密方式改为 hash

* 增加刷新防抖

Co-authored-by: songzhibin97 <718428482@qq.com>
Co-authored-by: icedays <icedays@163.com>
Co-authored-by: hedeqiang <laravel_code@163.com>
This commit is contained in:
奇淼(piexlmax
2022-04-25 17:34:17 +08:00
committed by GitHub
co-authored by songzhibin97 icedays hedeqiang
parent 843e5a9ad4
commit 6add2094a6
42 changed files with 635 additions and 43 deletions
@@ -0,0 +1,35 @@
package api
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
{{ if .NeedModel }} "github.com/flipped-aurora/gin-vue-admin/server/plugin/{{ .Snake}}/model" {{ end }}
"github.com/flipped-aurora/gin-vue-admin/server/plugin/{{ .Snake}}/service"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
type {{ .PlugName}}Api struct{}
// @Tags {{ .PlugName}}
// @Summary 请手动填写接口功能
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"发送成功"}"
// @Router /{{ .RouterGroup}}/routerName[post]
func (p *{{ .PlugName}}Api) ApiName(c *gin.Context) {
{{- if .HasRequest}}
var plug model.Request
_ = c.ShouldBindJSON(&plug)
{{ end -}}
if err{{- if .HasResponse }},res {{ end -}}:= service.ServiceGroupApp.PlugService({{ if .HasRequest }}plug{{ end -}}); err != nil {
global.GVA_LOG.Error("失败!", zap.Error(err))
response.FailWithMessage("失败", c)
} else {
{{if .HasResponse }}
response.OkWithDetailed(res,"成功",c)
{{else}}
response.OkWithData("成功", c)
{{ end -}}
}
}
@@ -0,0 +1,7 @@
package api
type ApiGroup struct {
{{ .PlugName}}Api
}
var ApiGroupApp = new(ApiGroup)