From d1c1f73e704a0b302feb812f35c7753e8ac3ad30 Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Tue, 17 Mar 2020 17:18:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=AA=8C=E8=AF=81=E7=A0=81?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QMPlusServer/controller/api/sys_captcha.go | 8 ------- QMPlusServer/controller/servers/captcha.go | 2 +- QMPlusServer/docs/docs.go | 26 +--------------------- QMPlusServer/docs/swagger.json | 24 -------------------- QMPlusServer/docs/swagger.yaml | 16 ------------- 5 files changed, 2 insertions(+), 74 deletions(-) diff --git a/QMPlusServer/controller/api/sys_captcha.go b/QMPlusServer/controller/api/sys_captcha.go index 58622cb3..237cb5d6 100644 --- a/QMPlusServer/controller/api/sys_captcha.go +++ b/QMPlusServer/controller/api/sys_captcha.go @@ -1,7 +1,6 @@ package api import ( - "fmt" "gin-vue-admin/controller/servers" "github.com/dchest/captcha" "github.com/gin-gonic/gin" @@ -13,20 +12,14 @@ import ( // @Security ApiKeyAuth // @accept application/json // @Produce application/json -// @Param data body modelInterface.PageInfo true "生成验证码" // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" // @Router /base/captcha [post] func Captcha(c *gin.Context) { captchaId := captcha.NewLen(6) - if err:= captcha.Server(captcha.StdWidth,captcha.StdHeight);err != nil{ - servers.ReportFormat(c,true,fmt.Sprintf("验证码获取失败:%v",err),gin.H{}) - }else{ servers.ReportFormat(c,true,"验证码获取成功",gin.H{ "captchaId":captchaId, "picPath":"/base/captcha/"+captchaId+".png", }) - } - } // @Tags base @@ -34,7 +27,6 @@ func Captcha(c *gin.Context) { // @Security ApiKeyAuth // @accept application/json // @Produce application/json -// @Param data body modelInterface.PageInfo true "生成验证码图片路径" // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" // @Router /base/captcha/:captchaId [get] func CaptchaImg(c *gin.Context) { diff --git a/QMPlusServer/controller/servers/captcha.go b/QMPlusServer/controller/servers/captcha.go index 41c69aee..f7be5b9e 100644 --- a/QMPlusServer/controller/servers/captcha.go +++ b/QMPlusServer/controller/servers/captcha.go @@ -25,7 +25,7 @@ func GinCapthcaServeHTTP(w http.ResponseWriter, r *http.Request) { } lang := strings.ToLower(r.FormValue("lang")) download := path.Base(dir) == "download" - if Serve(w, r, id, ext, lang, download, captcha.StdWidth, captcha.StdHeight) == captcha.ErrNotFound { + if Serve(w, r, id, ext, lang, download, 120, 40) == captcha.ErrNotFound { http.NotFound(w, r) } } diff --git a/QMPlusServer/docs/docs.go b/QMPlusServer/docs/docs.go index 5f1dedbe..9537f99c 100644 --- a/QMPlusServer/docs/docs.go +++ b/QMPlusServer/docs/docs.go @@ -1,6 +1,6 @@ // GENERATED BY THE COMMAND ABOVE; DO NOT EDIT // This file was generated by swaggo/swag at -// 2020-03-17 14:07:14.3860547 +0800 CST m=+0.077792301 +// 2020-03-17 15:18:08.5115326 +0800 CST m=+0.098737601 package docs @@ -421,18 +421,6 @@ var doc = `{ "base" ], "summary": "生成验证码", - "parameters": [ - { - "description": "生成验证码", - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "$ref": "#/definitions/modelInterface.PageInfo" - } - } - ], "responses": { "200": { "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", @@ -460,18 +448,6 @@ var doc = `{ "base" ], "summary": "生成验证码图片路径", - "parameters": [ - { - "description": "生成验证码图片路径", - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "$ref": "#/definitions/modelInterface.PageInfo" - } - } - ], "responses": { "200": { "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", diff --git a/QMPlusServer/docs/swagger.json b/QMPlusServer/docs/swagger.json index f66f6034..622be52f 100644 --- a/QMPlusServer/docs/swagger.json +++ b/QMPlusServer/docs/swagger.json @@ -404,18 +404,6 @@ "base" ], "summary": "生成验证码", - "parameters": [ - { - "description": "生成验证码", - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "$ref": "#/definitions/modelInterface.PageInfo" - } - } - ], "responses": { "200": { "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", @@ -443,18 +431,6 @@ "base" ], "summary": "生成验证码图片路径", - "parameters": [ - { - "description": "生成验证码图片路径", - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "$ref": "#/definitions/modelInterface.PageInfo" - } - } - ], "responses": { "200": { "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", diff --git a/QMPlusServer/docs/swagger.yaml b/QMPlusServer/docs/swagger.yaml index 6341347b..78c28848 100644 --- a/QMPlusServer/docs/swagger.yaml +++ b/QMPlusServer/docs/swagger.yaml @@ -544,14 +544,6 @@ paths: post: consumes: - application/json - parameters: - - description: 生成验证码 - in: body - name: data - required: true - schema: - $ref: '#/definitions/modelInterface.PageInfo' - type: object produces: - application/json responses: @@ -568,14 +560,6 @@ paths: get: consumes: - application/json - parameters: - - description: 生成验证码图片路径 - in: body - name: data - required: true - schema: - $ref: '#/definitions/modelInterface.PageInfo' - type: object produces: - application/json responses: -- GitLab