mirror of
https://github.com/ZxwyWebSite/lx-source.git
synced 2025-07-05 19:49:03 +08:00
28 lines
506 B
Go
28 lines
506 B
Go
package wy
|
|
|
|
import (
|
|
"net/http"
|
|
"strings"
|
|
)
|
|
|
|
// 登录刷新
|
|
func LoginRefresh(query ReqQuery) (*ReqAnswer, error) {
|
|
res, err := createRequest(
|
|
http.MethodPost,
|
|
`https://music.163.com/weapi/login/token/refresh`,
|
|
map[string]any{},
|
|
reqOptions{
|
|
Crypto: `weapi`,
|
|
UA: `pc`,
|
|
Cookie: query.Cookie,
|
|
RealIP: query.RealIP,
|
|
},
|
|
)
|
|
if code, ok := res.Body[`code`].(int); ok && err == nil {
|
|
if code == 200 {
|
|
res.Body[`cookie`] = strings.Join(res.Cookie, `;`)
|
|
}
|
|
}
|
|
return res, err
|
|
}
|