服务启动刷新游客cookie

This commit is contained in:
binaryify
2022-05-29 21:45:48 +08:00
parent 9e5c9372fe
commit b3ca43267a
8 changed files with 47 additions and 9 deletions
+2 -2
View File
@@ -43,7 +43,7 @@ const chooseUserAgent = (ua = false) => {
? realUserAgentList[Math.floor(Math.random() * realUserAgentList.length)]
: ua
}
const createRequest = (method, url, data, options) => {
const createRequest = (method, url, data = {}, options) => {
return new Promise((resolve, reject) => {
let headers = { 'User-Agent': chooseUserAgent(options.ua) }
if (method.toUpperCase() === 'POST')
@@ -54,7 +54,7 @@ const createRequest = (method, url, data, options) => {
// headers['X-Real-IP'] = '118.88.88.88'
if (typeof options.cookie === 'object') {
if (!options.cookie.MUSIC_U) {
// 匿名
// 游客
if (!options.cookie.MUSIC_A) {
options.cookie.MUSIC_A = config.anonymous_token
}