Skip to content

Commit 974a809

Browse files
authored
Merge pull request #546 from go-admin-team/dev
Dev
2 parents 49e4c19 + bb83a97 commit 974a809

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

app/admin/apis/sys_post.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package apis
22

33
import (
44
"fmt"
5+
56
"github.com/gin-gonic/gin"
67
"github.com/gin-gonic/gin/binding"
78
"github.com/go-admin-team/go-admin-core/sdk/api"
@@ -93,8 +94,7 @@ func (e SysPost) Get(c *gin.Context) {
9394
// @Accept application/json
9495
// @Product application/json
9596
// @Param data body dto.SysPostInsertReq true "data"
96-
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
97-
// @Success 200 {string} string "{"code": -1, "message": "添加失败"}"
97+
// @Success 200 {object} response.Response "{"code": 200, "data": [...]}"
9898
// @Router /api/v1/post [post]
9999
// @Security Bearer
100100
func (e SysPost) Insert(c *gin.Context) {
@@ -126,8 +126,7 @@ func (e SysPost) Insert(c *gin.Context) {
126126
// @Accept application/json
127127
// @Product application/json
128128
// @Param data body dto.SysPostUpdateReq true "body"
129-
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
130-
// @Success 200 {string} string "{"code": -1, "message": "添加失败"}"
129+
// @Success 200 {object} response.Response "{"code": 200, "data": [...]}"
131130
// @Router /api/v1/post/{id} [put]
132131
// @Security Bearer
133132
func (e SysPost) Update(c *gin.Context) {
@@ -159,8 +158,7 @@ func (e SysPost) Update(c *gin.Context) {
159158
// @Description 删除数据
160159
// @Tags 岗位
161160
// @Param id body dto.SysPostDeleteReq true "请求参数"
162-
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
163-
// @Success 500 {string} string "{"code": 500, "message": "删除失败"}"
161+
// @Success 200 {object} response.Response "{"code": 200, "data": [...]}"
164162
// @Router /api/v1/post [delete]
165163
// @Security Bearer
166164
func (e SysPost) Delete(c *gin.Context) {
@@ -183,4 +181,4 @@ func (e SysPost) Delete(c *gin.Context) {
183181
return
184182
}
185183
e.OK(req.GetId(), "删除成功")
186-
}
184+
}

common/middleware/auth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func AuthInit() (*jwt.GinJWTMiddleware, error) {
2020
}
2121
return jwt.New(&jwt.GinJWTMiddleware{
2222
Realm: "test zone",
23-
Key: []byte(config.ApplicationConfig.JwtSecret),
23+
Key: []byte(config.JwtConfig.Secret),
2424
Timeout: timeout,
2525
MaxRefresh: time.Hour,
2626
PayloadFunc: handler.PayloadFunc,
@@ -33,4 +33,4 @@ func AuthInit() (*jwt.GinJWTMiddleware, error) {
3333
TimeFunc: time.Now,
3434
})
3535

36-
}
36+
}

0 commit comments

Comments
 (0)