不全多删除的部分

This commit is contained in:
linwenxiang committed 2021-02-05 10:30:48 +08:00
1 parent 7ce090af38
commit 981e992f28
1 file changed
+2
+2
View File
@@ -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