diff --git a/app/hdl/hdl_demo.go b/app/hdl/hdl_demo.go index 3c4c64e..ebe1ae2 100644 --- a/app/hdl/hdl_demo.go +++ b/app/hdl/hdl_demo.go @@ -127,3 +127,15 @@ func CreateSign(c *gin.Context) { }, nil) return } + +func AesDecryptByECB(c *gin.Context) { + body, _ := ioutil.ReadAll(c.Request.Body) + strs, err := aes.AesDecryptByECB(md.AesKey, string(body)) + if err != nil { + e.OutErr(c, e.ERR, err.Error()) + return + } + + e.OutSuc(c, strs, nil) + return +} diff --git a/app/router/router.go b/app/router/router.go index e1a45f8..7ca16a0 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -49,6 +49,7 @@ func Init() *gin.Engine { func route(r *gin.RouterGroup) { r.GET("/test", hdl.Demo) r.Any("/createSign", hdl.CreateSign) + r.Any("/aesDecryptByECB", hdl.AesDecryptByECB) r.Use(mw.CheckSign) r.Any("/testCreateSign", hdl.TestCreateSign) r.POST("/register", hdl.Register)