不全多删除的部分

This commit is contained in:
linwenxiang
2021-02-05 10:30:48 +08:00
parent 7ce090af38
commit 981e992f28
+2
View File
@@ -8,6 +8,7 @@ import (
"strconv"
"github.com/gin-gonic/gin"
"github.com/google/uuid"
"golang.org/x/crypto/bcrypt"
"gorm.io/gorm"
)
@@ -58,6 +59,7 @@ func HasError(err error, msg string, code ...int) {
func GenerateMsgIDFromContext(c *gin.Context) string {
requestId := c.GetHeader(TrafficKey)
if requestId == "" {
requestId = uuid.New().String()
c.Header(TrafficKey, requestId)
}
return requestId