不全多删除的部分
This commit is contained in:
1 parent
7ce090af38
commit
981e992f28
1 file changed
+2
@@ -8,6 +8,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
"github.com/google/uuid"
|
||||||
"golang.org/x/crypto/bcrypt"
|
"golang.org/x/crypto/bcrypt"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
@@ -58,6 +59,7 @@ func HasError(err error, msg string, code ...int) {
|
|||||||
func GenerateMsgIDFromContext(c *gin.Context) string {
|
func GenerateMsgIDFromContext(c *gin.Context) string {
|
||||||
requestId := c.GetHeader(TrafficKey)
|
requestId := c.GetHeader(TrafficKey)
|
||||||
if requestId == "" {
|
if requestId == "" {
|
||||||
|
requestId = uuid.New().String()
|
||||||
c.Header(TrafficKey, requestId)
|
c.Header(TrafficKey, requestId)
|
||||||
}
|
}
|
||||||
return requestId
|
return requestId
|
||||||
|
|||||||
Reference in new issue
Block a user