mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 10:13:01 +00:00
修改action和模版,使用log打印日志,修复job删除问题,已经所有删除问题
This commit is contained in:
@@ -5,6 +5,9 @@ import (
|
||||
"runtime"
|
||||
"strconv"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/google/uuid"
|
||||
"github.com/spf13/cast"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
)
|
||||
|
||||
@@ -57,3 +60,16 @@ func HasError(err error, msg string, code ...int) {
|
||||
panic("CustomError#" + strconv.Itoa(statusCode) + "#" + msg)
|
||||
}
|
||||
}
|
||||
|
||||
// GenerateMsgIDFromContext 生成msgID
|
||||
func GenerateMsgIDFromContext(c *gin.Context) string {
|
||||
var msgID string
|
||||
data, ok := c.Get("msgID")
|
||||
if !ok {
|
||||
msgID = uuid.New().String()
|
||||
c.Set("msgID", msgID)
|
||||
return msgID
|
||||
}
|
||||
msgID = cast.ToString(data)
|
||||
return msgID
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user