zhangqian
2024-02-06 d28815a491eac43ad9153b7a83f27ce72d64a47e
兼容
2个文件已修改
12 ■■■■ 已修改文件
middleware/reset_pwd.go 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/request/jwt.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
middleware/reset_pwd.go
@@ -16,8 +16,14 @@
            return
        }
        claims := params.(*request.CustomClaims)
        if !claims.ModifiedPwd {
            ctx.Fail(ecode.DBErr)
        if claims.ModifiedPwd == nil { //兼容没有ModifiedPwd值的token
            ctx.Fail(ecode.JWTExpire)
            c.Abort()
            return
        }
        if !*claims.ModifiedPwd {
            ctx.Fail(ecode.ResetPwd)
            c.Abort()
            return
        }
model/request/jwt.go
@@ -21,5 +21,5 @@
    ParentId    string
    UserType    constvar.UserType
    AuthorityId uint
    ModifiedPwd bool
    ModifiedPwd *bool
}