From b9d0318b452ffbcb87b7733e580d7fed7b1303d3 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Sat, 18 Jul 2020 14:24:59 +0800 Subject: [PATCH] doc: swagger add auth tag --- apis/log/loginLog.go | 4 +-- apis/log/operlog.go | 4 +-- apis/system/config.go | 6 ++--- apis/system/dept.go | 4 +-- apis/system/dict/dictData.go | 6 ++--- apis/system/dict/dictType.go | 4 +-- apis/system/post.go | 4 +-- apis/system/role.go | 2 +- apis/system/sysuser.go | 6 ++--- apis/tools/gen.go | 2 +- apis/tools/systables.go | 2 +- docs/docs.go | 50 ++++++++++++++++++------------------ docs/swagger.json | 48 +++++++++++++++++----------------- docs/swagger.yaml | 48 +++++++++++++++++----------------- handler/auth.go | 2 +- main.go | 2 +- 16 files changed, 97 insertions(+), 97 deletions(-) diff --git a/apis/log/loginLog.go b/apis/log/loginLog.go index 891b081..30e20c9 100644 --- a/apis/log/loginLog.go +++ b/apis/log/loginLog.go @@ -19,7 +19,7 @@ import ( // @Param pageIndex query int false "页码" // @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/loginloglist [get] -// @Security +// @Security Bearer func GetLoginLogList(c *gin.Context) { var data models.LoginLog var err error @@ -59,7 +59,7 @@ func GetLoginLogList(c *gin.Context) { // @Param infoId path int true "infoId" // @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/loginlog/{infoId} [get] -// @Security +// @Security Bearer func GetLoginLog(c *gin.Context) { var LoginLog models.LoginLog LoginLog.InfoId, _ = tools.StringToInt(c.Param("infoId")) diff --git a/apis/log/operlog.go b/apis/log/operlog.go index b2e1c3f..a9b9fc1 100644 --- a/apis/log/operlog.go +++ b/apis/log/operlog.go @@ -19,7 +19,7 @@ import ( // @Param pageIndex query int false "页码" // @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/operloglist [get] -// @Security +// @Security Bearer func GetOperLogList(c *gin.Context) { var data models.SysOperLog var err error @@ -60,7 +60,7 @@ func GetOperLogList(c *gin.Context) { // @Param infoId path int true "infoId" // @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/operlog/{infoId} [get] -// @Security +// @Security Bearer func GetOperLog(c *gin.Context) { var OperLog models.SysOperLog OperLog.OperId, _ = tools.StringToInt(c.Param("operId")) diff --git a/apis/system/config.go b/apis/system/config.go index 8517bc7..13b88a2 100644 --- a/apis/system/config.go +++ b/apis/system/config.go @@ -20,7 +20,7 @@ import ( // @Param pageIndex query int false "页码" // @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/configList [get] -// @Security +// @Security Bearer func GetConfigList(c *gin.Context) { var data models.SysConfig var err error @@ -60,7 +60,7 @@ func GetConfigList(c *gin.Context) { // @Param configId path int true "配置编码" // @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/config/{configId} [get] -// @Security +// @Security Bearer func GetConfig(c *gin.Context) { var Config models.SysConfig Config.ConfigId, _ = tools.StringToInt(c.Param("configId")) @@ -79,7 +79,7 @@ func GetConfig(c *gin.Context) { // @Param configKey path int true "configKey" // @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/configKey/{configKey} [get] -// @Security +// @Security Bearer func GetConfigByConfigKey(c *gin.Context) { var Config models.SysConfig Config.ConfigKey = c.Param("configKey") diff --git a/apis/system/dept.go b/apis/system/dept.go index 60839be..832ae34 100644 --- a/apis/system/dept.go +++ b/apis/system/dept.go @@ -17,7 +17,7 @@ import ( // @Param position query string false "position" // @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/deptList [get] -// @Security +// @Security Bearer func GetDeptList(c *gin.Context) { var Dept models.SysDept Dept.DeptName = c.Request.FormValue("deptName") @@ -46,7 +46,7 @@ func GetDeptTree(c *gin.Context) { // @Param position query string false "position" // @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/dept/{deptId} [get] -// @Security +// @Security Bearer func GetDept(c *gin.Context) { var Dept models.SysDept Dept.DeptId, _ = tools.StringToInt(c.Param("deptId")) diff --git a/apis/system/dict/dictData.go b/apis/system/dict/dictData.go index 84c9950..a2bd8b0 100644 --- a/apis/system/dict/dictData.go +++ b/apis/system/dict/dictData.go @@ -19,7 +19,7 @@ import ( // @Param pageIndex query int false "页码" // @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/dict/data/list [get] -// @Security +// @Security Bearer func GetDictDataList(c *gin.Context) { var data models.DictData var err error @@ -61,7 +61,7 @@ func GetDictDataList(c *gin.Context) { // @Param dictCode path int true "字典编码" // @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/dict/data/{dictCode} [get] -// @Security +// @Security Bearer func GetDictData(c *gin.Context) { var DictData models.DictData DictData.DictLabel = c.Request.FormValue("dictLabel") @@ -79,7 +79,7 @@ func GetDictData(c *gin.Context) { // @Param dictType path int true "dictType" // @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/dict/databyType/{dictType} [get] -// @Security +// @Security Bearer func GetDictDataByDictType(c *gin.Context) { var DictData models.DictData DictData.DictType = c.Param("dictType") diff --git a/apis/system/dict/dictType.go b/apis/system/dict/dictType.go index 41a7648..95b21c2 100644 --- a/apis/system/dict/dictType.go +++ b/apis/system/dict/dictType.go @@ -19,7 +19,7 @@ import ( // @Param pageIndex query int false "页码" // @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/dict/type/list [get] -// @Security +// @Security Bearer func GetDictTypeList(c *gin.Context) { var data models.DictType var err error @@ -59,7 +59,7 @@ func GetDictTypeList(c *gin.Context) { // @Param dictId path int true "字典类型编码" // @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/dict/type/{dictId} [get] -// @Security +// @Security Bearer func GetDictType(c *gin.Context) { var DictType models.DictType DictType.DictName = c.Request.FormValue("dictName") diff --git a/apis/system/post.go b/apis/system/post.go index a793c6d..af1315d 100644 --- a/apis/system/post.go +++ b/apis/system/post.go @@ -16,7 +16,7 @@ import ( // @Param status query string false "status" // @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/post [get] -// @Security +// @Security Bearer func GetPostList(c *gin.Context) { var data models.Post var err error @@ -48,7 +48,7 @@ func GetPostList(c *gin.Context) { // @Param postId path int true "postId" // @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/post/{postId} [get] -// @Security +// @Security Bearer func GetPost(c *gin.Context) { var Post models.Post Post.PostId, _ = tools.StringToInt(c.Param("postId")) diff --git a/apis/system/role.go b/apis/system/role.go index f4c303c..b987bd1 100644 --- a/apis/system/role.go +++ b/apis/system/role.go @@ -18,7 +18,7 @@ import ( // @Param pageIndex query int false "页码" // @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/rolelist [get] -// @Security +// @Security Bearer func GetRoleList(c *gin.Context) { var data models.SysRole var err error diff --git a/apis/system/sysuser.go b/apis/system/sysuser.go index 3f40adb..b2b0a90 100644 --- a/apis/system/sysuser.go +++ b/apis/system/sysuser.go @@ -57,7 +57,7 @@ func GetSysUserList(c *gin.Context) { // @Param userId path int true "用户编码" // @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/sysUser/{userId} [get] -// @Security +// @Security Bearer func GetSysUser(c *gin.Context) { var SysUser models.SysUser SysUser.UserId, _ = tools.StringToInt(c.Param("userId")) @@ -88,7 +88,7 @@ func GetSysUser(c *gin.Context) { // @Tags 个人中心 // @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/user/profile [get] -// @Security +// @Security Bearer func GetSysUserProfile(c *gin.Context) { var SysUser models.SysUser userId := tools.GetUserIdStr(c) @@ -128,7 +128,7 @@ func GetSysUserProfile(c *gin.Context) { // @Tags 用户 // @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/sysUser [get] -// @Security +// @Security Bearer func GetSysUserInit(c *gin.Context) { var SysRole models.SysRole var Post models.Post diff --git a/apis/tools/gen.go b/apis/tools/gen.go index 8f38992..ab061af 100644 --- a/apis/tools/gen.go +++ b/apis/tools/gen.go @@ -97,7 +97,7 @@ func GenMenuAndApi(c *gin.Context) { Mmenu.Permission = tab.PackageName + ":" + tab.ModuleName + ":list" Mmenu.ParentId = 0 Mmenu.NoCache = false - Mmenu.Component = tab.ModuleName + "/index" + Mmenu.Component = "/" + tab.ModuleName + "/index" Mmenu.Sort = 0 Mmenu.Visible = "0" Mmenu.IsFrame = "0" diff --git a/apis/tools/systables.go b/apis/tools/systables.go index b7db043..f28fe97 100644 --- a/apis/tools/systables.go +++ b/apis/tools/systables.go @@ -54,7 +54,7 @@ func GetSysTableList(c *gin.Context) { // @Param configKey path int true "configKey" // @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/sys/tables/info/{tableId} [get] -// @Security +// @Security Bearer func GetSysTables(c *gin.Context) { var data tools.SysTables data.TableId, _ = tools2.StringToInt(c.Param("tableId")) diff --git a/docs/docs.go b/docs/docs.go index 31f2b0a..34770ed 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1,6 +1,6 @@ // GENERATED BY THE COMMAND ABOVE; DO NOT EDIT // This file was generated by swaggo/swag at -// 2020-07-15 20:40:18.457047 +0800 CST m=+0.111190243 +// 2020-07-17 22:43:59.920467 +0800 CST m=+0.161144112 package docs @@ -70,7 +70,7 @@ var doc = `{ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -125,7 +125,7 @@ var doc = `{ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -156,7 +156,7 @@ var doc = `{ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -363,7 +363,7 @@ var doc = `{ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -425,7 +425,7 @@ var doc = `{ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "分页列表", @@ -539,7 +539,7 @@ var doc = `{ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -593,7 +593,7 @@ var doc = `{ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -648,7 +648,7 @@ var doc = `{ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -751,7 +751,7 @@ var doc = `{ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -805,7 +805,7 @@ var doc = `{ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -932,7 +932,7 @@ var doc = `{ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -987,7 +987,7 @@ var doc = `{ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -1359,7 +1359,7 @@ var doc = `{ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -1416,7 +1416,7 @@ var doc = `{ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -1470,7 +1470,7 @@ var doc = `{ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -1590,7 +1590,7 @@ var doc = `{ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -1767,7 +1767,7 @@ var doc = `{ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "Get JSON", @@ -1951,7 +1951,7 @@ var doc = `{ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -2043,7 +2043,7 @@ var doc = `{ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -2095,7 +2095,7 @@ var doc = `{ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -2212,7 +2212,7 @@ var doc = `{ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -2261,7 +2261,7 @@ var doc = `{ }, "/login": { "post": { - "description": "获取token\nLoginHandler can be used by clients to get a jwt token.\nPayload needs to be json in the form of {\"username\": \"USERNAME\", \"password\": \"PASSWORD\"}.\nReply will be of the form {\"token\": \"TOKEN\"}.\ndev mode:It should be noted that all fields cannot be empty, and a value of 0 can be passed in addition to the account password\n开发模式:需要注意全部字段不能为空,账号密码外可以传入0值", + "description": "获取token\nLoginHandler can be used by clients to get a jwt token.\nPayload needs to be json in the form of {\"username\": \"USERNAME\", \"password\": \"PASSWORD\"}.\nReply will be of the form {\"token\": \"TOKEN\"}.\ndev mode:It should be noted that all fields cannot be empty, and a value of 0 can be passed in addition to the account password\n注意:开发模式:需要注意全部字段不能为空,账号密码外可以传入0值", "consumes": [ "application/json" ], @@ -2292,7 +2292,7 @@ var doc = `{ "post": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取token", @@ -3341,7 +3341,7 @@ type swaggerInfo struct { // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = swaggerInfo{ - Version: "0.0.1", + Version: "1.0.1", Host: "", BasePath: "", Schemes: []string{}, diff --git a/docs/swagger.json b/docs/swagger.json index 31680ac..109f9b1 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -8,7 +8,7 @@ "name": "MIT", "url": "https://github.com/wenjianzhang/go-admin/blob/master/LICENSE.md" }, - "version": "0.0.1" + "version": "1.0.1" }, "paths": { "/api/v1/config": { @@ -52,7 +52,7 @@ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -107,7 +107,7 @@ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -138,7 +138,7 @@ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -345,7 +345,7 @@ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -407,7 +407,7 @@ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "分页列表", @@ -521,7 +521,7 @@ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -575,7 +575,7 @@ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -630,7 +630,7 @@ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -733,7 +733,7 @@ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -787,7 +787,7 @@ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -914,7 +914,7 @@ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -969,7 +969,7 @@ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -1341,7 +1341,7 @@ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -1398,7 +1398,7 @@ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -1452,7 +1452,7 @@ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -1572,7 +1572,7 @@ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -1749,7 +1749,7 @@ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "Get JSON", @@ -1933,7 +1933,7 @@ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -2025,7 +2025,7 @@ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -2077,7 +2077,7 @@ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -2194,7 +2194,7 @@ "get": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取JSON", @@ -2243,7 +2243,7 @@ }, "/login": { "post": { - "description": "获取token\nLoginHandler can be used by clients to get a jwt token.\nPayload needs to be json in the form of {\"username\": \"USERNAME\", \"password\": \"PASSWORD\"}.\nReply will be of the form {\"token\": \"TOKEN\"}.\ndev mode:It should be noted that all fields cannot be empty, and a value of 0 can be passed in addition to the account password\n开发模式:需要注意全部字段不能为空,账号密码外可以传入0值", + "description": "获取token\nLoginHandler can be used by clients to get a jwt token.\nPayload needs to be json in the form of {\"username\": \"USERNAME\", \"password\": \"PASSWORD\"}.\nReply will be of the form {\"token\": \"TOKEN\"}.\ndev mode:It should be noted that all fields cannot be empty, and a value of 0 can be passed in addition to the account password\n注意:开发模式:需要注意全部字段不能为空,账号密码外可以传入0值", "consumes": [ "application/json" ], @@ -2274,7 +2274,7 @@ "post": { "security": [ { - "": [] + "Bearer": [] } ], "description": "获取token", diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 94377e4..a393c9b 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -632,7 +632,7 @@ info: name: MIT url: https://github.com/wenjianzhang/go-admin/blob/master/LICENSE.md title: go-admin API - version: 0.0.1 + version: 1.0.1 paths: /api/v1/config: put: @@ -688,7 +688,7 @@ paths: schema: $ref: '#/definitions/app.Response' security: - - "": [] + - Bearer: [] summary: 获取配置 tags: - 配置 @@ -707,7 +707,7 @@ paths: schema: $ref: '#/definitions/app.Response' security: - - "": [] + - Bearer: [] summary: 获取配置 tags: - 配置 @@ -741,7 +741,7 @@ paths: schema: $ref: '#/definitions/app.Response' security: - - "": [] + - Bearer: [] summary: 配置列表数据 tags: - 配置 @@ -861,7 +861,7 @@ paths: schema: $ref: '#/definitions/app.Response' security: - - "": [] + - Bearer: [] summary: 部门列表数据 tags: - 部门 @@ -904,7 +904,7 @@ paths: schema: $ref: '#/definitions/app.Response' security: - - "": [] + - Bearer: [] summary: 分页部门列表数据 tags: - 部门 @@ -984,7 +984,7 @@ paths: schema: $ref: '#/definitions/app.Response' security: - - "": [] + - Bearer: [] summary: 通过编码获取字典数据 tags: - 字典数据 @@ -1018,7 +1018,7 @@ paths: schema: $ref: '#/definitions/app.Response' security: - - "": [] + - Bearer: [] summary: 字典数据列表 tags: - 字典数据 @@ -1037,7 +1037,7 @@ paths: schema: $ref: '#/definitions/app.Response' security: - - "": [] + - Bearer: [] summary: 通过字典类型获取字典数据 tags: - 字典数据 @@ -1117,7 +1117,7 @@ paths: schema: $ref: '#/definitions/app.Response' security: - - "": [] + - Bearer: [] summary: 通过字典id获取字典类型 tags: - 字典类型 @@ -1151,7 +1151,7 @@ paths: schema: $ref: '#/definitions/app.Response' security: - - "": [] + - Bearer: [] summary: 字典类型列表数据 tags: - 字典类型 @@ -1231,7 +1231,7 @@ paths: schema: $ref: '#/definitions/app.Response' security: - - "": [] + - Bearer: [] summary: 通过编码获取登录日志 tags: - 登录日志 @@ -1265,7 +1265,7 @@ paths: schema: $ref: '#/definitions/app.Response' security: - - "": [] + - Bearer: [] summary: 登录日志列表 tags: - 登录日志 @@ -1484,7 +1484,7 @@ paths: schema: $ref: '#/definitions/app.Response' security: - - "": [] + - Bearer: [] summary: 通过编码获取登录日志 tags: - 登录日志 @@ -1535,7 +1535,7 @@ paths: schema: $ref: '#/definitions/app.Response' security: - - "": [] + - Bearer: [] summary: 登录日志列表 tags: - 登录日志 @@ -1565,7 +1565,7 @@ paths: schema: $ref: '#/definitions/app.Response' security: - - "": [] + - Bearer: [] summary: 岗位列表数据 tags: - 岗位 @@ -1649,7 +1649,7 @@ paths: schema: $ref: '#/definitions/app.Response' security: - - "": [] + - Bearer: [] summary: 获取岗位信息 tags: - 岗位 @@ -1758,7 +1758,7 @@ paths: schema: $ref: '#/definitions/app.Response' security: - - "": [] + - Bearer: [] summary: 角色列表数据 tags: - 角色/Role @@ -1874,7 +1874,7 @@ paths: schema: $ref: '#/definitions/app.Response' security: - - "": [] + - Bearer: [] summary: 获取配置 tags: - 工具 - 生成表 @@ -1911,7 +1911,7 @@ paths: schema: $ref: '#/definitions/app.Response' security: - - "": [] + - Bearer: [] summary: 获取用户角色和职位 tags: - 用户 @@ -1950,7 +1950,7 @@ paths: schema: $ref: '#/definitions/app.Response' security: - - "": [] + - Bearer: [] summary: 获取用户 tags: - 用户 @@ -2018,7 +2018,7 @@ paths: schema: $ref: '#/definitions/app.Response' security: - - "": [] + - Bearer: [] summary: 获取个人中心用户 tags: - 个人中心 @@ -2051,7 +2051,7 @@ paths: Payload needs to be json in the form of {"username": "USERNAME", "password": "PASSWORD"}. Reply will be of the form {"token": "TOKEN"}. dev mode:It should be noted that all fields cannot be empty, and a value of 0 can be passed in addition to the account password - 开发模式:需要注意全部字段不能为空,账号密码外可以传入0值 + 注意:开发模式:需要注意全部字段不能为空,账号密码外可以传入0值 parameters: - description: account in: body @@ -2079,7 +2079,7 @@ paths: schema: type: string security: - - "": [] + - Bearer: [] summary: 退出登录 /sd/cpu: get: diff --git a/handler/auth.go b/handler/auth.go index 20e2175..7277763 100644 --- a/handler/auth.go +++ b/handler/auth.go @@ -122,7 +122,7 @@ func LoginLogToDB(c *gin.Context, status string, msg string, username string) { // @Product application/json // @Success 200 {string} string "{"code": 200, "msg": "成功退出系统" }" // @Router /logout [post] -// @Security +// @Security Bearer func LogOut(c *gin.Context) { var loginlog models.LoginLog ua := user_agent.New(c.Request.UserAgent()) diff --git a/main.go b/main.go index b6bc81e..1ce5f4f 100644 --- a/main.go +++ b/main.go @@ -5,7 +5,7 @@ import ( ) // @title go-admin API -// @version 0.0.1 +// @version 1.0.1 // @description 基于Gin + Vue + Element UI的前后端分离权限管理系统的接口文档 // @description 添加qq群: 74520518 进入技术交流群 请备注,谢谢! // @license.name MIT