uni-app调用qq音乐搜索音乐列表接口,跨域配置
mainfest.json配置代理域名
"devServer": {
"https": false,
"disableHostCheck": true,
"proxy": {
"/api/getMusicList": {
"target": "https://c.y.qq.com/soso/fcgi-bin/search_for_qq_cp",
"headers":{
"referer":"https://c.y.qq.com/",
"host":"c.y.qq.com"
},
"pathRewrite": {
"^/api/getMusicList": ""
}
}
}
},
新建qqMusic.js 写入api
import request from '@/utils/request.js'
module.exports = {
/**
* 音乐列表
* @param {Object} params
* @param {Obje