mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
去除冗余split
This commit is contained in:
parent
e652825266
commit
f715d1ff8a
@ -182,10 +182,10 @@ func (c *QQClient) GetGroupHonorInfo(groupCode int64, honorType HonorType) (*Gro
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
rsp := string(b)
|
||||
data := strings.Split(strings.Split(rsp, `window.__INITIAL_STATE__=`)[1], "</script>")[0]
|
||||
b = b[bytes.Index(b, []byte(`window.__INITIAL_STATE__=`))+25:]
|
||||
b = b[:bytes.Index(b, []byte("</script>"))]
|
||||
ret := GroupHonorInfo{}
|
||||
err = json.Unmarshal([]byte(data), &ret)
|
||||
err = json.Unmarshal(b, &ret)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user