Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

post请求带上cookie后请求song URL出现TypeError #1005

Closed
Clarkkkk opened this issue Oct 28, 2020 · 1 comment
Closed

post请求带上cookie后请求song URL出现TypeError #1005

Clarkkkk opened this issue Oct 28, 2020 · 1 comment

Comments

@Clarkkkk
Copy link
Contributor

环境

  • 系统/平台: centOS

  • nodejs 版本: v12.19.0

  • API版本: 3.45.1

出现问题

post请求带上cookie后请求song URL出现TypeError。

重现步骤

使用的接口是/song/url,请求方式:

fetch(requestURL, {
    method: 'post',
    headers: {'Content-Type': 'application/json;charset=utf-8'},
    body: {
         credentials: 'include',
         cookie: cookie,
    }
  })

错误信息是TypeError: Cannot use 'in' operator to search for 'MUSIC_U' in...。知道有相关的isuue,可能是请求方式不同?在song_url.js中加入:

const { cookieToJson } = require('../util/index')
if(typeof query.cookie === 'string'){
    query.cookie = cookieToJson(query.cookie)
}

已经解决,来回报一下。

@Binaryify
Copy link
Owner

确实疏忽了这个,抽空改一下

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants