Fix JSON issue in GenerateCasToken()

This commit is contained in:
Yang Luo 2023-09-13 16:45:11 +08:00
parent ea1414dfd0
commit bb04b10e8b

View File

@ -77,9 +77,9 @@ type CasUserAttributes struct {
} }
type CasNamedAttribute struct { type CasNamedAttribute struct {
XMLName xml.Name `xml:"cas:attribute" json:"-"` XMLName xml.Name `xml:"cas:attribute" json:"-"`
Name string `xml:"name,attr,omitempty"` Name string `xml:"name,attr,omitempty"`
Value string `xml:",innerxml"` Value interface{} `xml:",innerxml"`
} }
type CasAnyAttribute struct { type CasAnyAttribute struct {
@ -209,7 +209,7 @@ func GenerateCasToken(userId string, service string) (string, error) {
return "", err return "", err
} }
tmp := map[string]string{} tmp := map[string]interface{}{}
err = json.Unmarshal(data, &tmp) err = json.Unmarshal(data, &tmp)
if err != nil { if err != nil {
return "", err return "", err