mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-02-08 22:05:36 +08:00
refactor: interface{} -> any
feat: 新增外链菜单
This commit is contained in:
@@ -81,7 +81,7 @@ func getLogMsg(rc *Ctx) string {
|
||||
return msg
|
||||
}
|
||||
|
||||
func getErrMsg(rc *Ctx, err interface{}) string {
|
||||
func getErrMsg(rc *Ctx, err any) string {
|
||||
msg := rc.LogInfo.Description
|
||||
if !utils.IsBlank(rc.ReqParam) {
|
||||
msg = msg + fmt.Sprintf("\n--> %s", utils.ToString(rc.ReqParam))
|
||||
|
||||
@@ -106,7 +106,7 @@ func UseAfterHandlerInterceptor(b HandlerInterceptorFunc) {
|
||||
}
|
||||
|
||||
// 应用指定处理器拦截器,如果有一个错误则直接返回错误
|
||||
func ApplyHandlerInterceptor(his HandlerInterceptors, rc *Ctx) interface{} {
|
||||
func ApplyHandlerInterceptor(his HandlerInterceptors, rc *Ctx) any {
|
||||
for _, handler := range his {
|
||||
if err := handler(rc); err != nil {
|
||||
return err
|
||||
|
||||
@@ -50,7 +50,7 @@ func ParseToken(tokenStr string) (*model.LoginAccount, error) {
|
||||
return nil, errors.New("token error")
|
||||
}
|
||||
// Parse token
|
||||
token, err := jwt.Parse(tokenStr, func(token *jwt.Token) (interface{}, error) {
|
||||
token, err := jwt.Parse(tokenStr, func(token *jwt.Token) (any, error) {
|
||||
return []byte(JwtKey), nil
|
||||
})
|
||||
if err != nil || token == nil {
|
||||
|
||||
Reference in New Issue
Block a user