1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00

去除冗余split

This commit is contained in:
LXY 2020-08-21 17:24:46 +08:00 committed by GitHub
parent e652825266
commit f715d1ff8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -182,10 +182,10 @@ func (c *QQClient) GetGroupHonorInfo(groupCode int64, honorType HonorType) (*Gro
if err != nil { if err != nil {
return nil, err return nil, err
} }
rsp := string(b) b = b[bytes.Index(b, []byte(`window.__INITIAL_STATE__=`))+25:]
data := strings.Split(strings.Split(rsp, `window.__INITIAL_STATE__=`)[1], "</script>")[0] b = b[:bytes.Index(b, []byte("</script>"))]
ret := GroupHonorInfo{} ret := GroupHonorInfo{}
err = json.Unmarshal([]byte(data), &ret) err = json.Unmarshal(b, &ret)
if err != nil { if err != nil {
return nil, err return nil, err
} }