This commit is contained in:
laodaming
2023-11-21 18:19:14 +08:00
parent 3c6aadb253
commit 040016d88f
15 changed files with 20 additions and 16 deletions

View File

@@ -1,9 +1,13 @@
package ldap_lib
import "github.com/zeromicro/go-zero/core/logx"
import (
"github.com/zeromicro/go-zero/core/logx"
"net/http"
)
// 验证权限
func (l *Ldap) VerifyAuthority(token, jwtSecret string) bool {
func (l *Ldap) VerifyAuthority(r *http.Request, jwtSecret string) bool {
token := r.Header.Get("Ldap-Authorization")
info, err := l.ParseJwtToken(token, jwtSecret)
if err != nil {
logx.Error("解析token失败", err, "----token:", token)