File tree 4 files changed +8
-6
lines changed
4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,12 @@ import (
25
25
"github.com/gin-gonic/gin"
26
26
)
27
27
28
+ const (
29
+ requestIdHeader = "x-envcd-request-id"
30
+ // tokenHeader
31
+ tokenHeader = "x-envcd-token"
32
+ )
33
+
28
34
// buildContext build plugin context
29
35
// @param params params
30
36
// @return *context.Context context
Original file line number Diff line number Diff line change @@ -33,8 +33,6 @@ import (
33
33
"github.com/gin-gonic/gin"
34
34
)
35
35
36
- var requestIdHeader = "x-envcd-request-id"
37
-
38
36
type PageListVO struct {
39
37
Page int64 `json:"page"`
40
38
PageSize int64 `json:"pageSize"`
Original file line number Diff line number Diff line change @@ -32,8 +32,6 @@ import (
32
32
const (
33
33
// hmacSecret secret
34
34
hmacSecret = "9C035514A15F78"
35
- // tokenHeader
36
- tokenHeader = "token"
37
35
)
38
36
39
37
// authorizationClaims claims
Original file line number Diff line number Diff line change @@ -92,7 +92,8 @@ func (openapi *Openapi) login(ginCtx *gin.Context) {
92
92
return result .InternalFailure (err )
93
93
}
94
94
95
- users , err := dao .New (openapi .storage ).SelectUser (entity.User {
95
+ daoAction := dao .New (openapi .storage )
96
+ users , err := daoAction .SelectUser (entity.User {
96
97
Name : param .Username ,
97
98
})
98
99
if err != nil {
@@ -114,7 +115,6 @@ func (openapi *Openapi) login(ginCtx *gin.Context) {
114
115
if err != nil {
115
116
return result .InternalFailure (err )
116
117
}
117
- daoAction := dao .New (openapi .storage )
118
118
user .UserSession = token
119
119
if _ , err := daoAction .UpdateUser (user ); err != nil {
120
120
return result .InternalFailure (err )
You can’t perform that action at this time.
0 commit comments