优化网络请求,尝试去解决无法连接服务器的问题

This commit is contained in:
lyswhut
2021-06-16 10:23:48 +08:00
parent 66631ac105
commit 198238d4b5
13 changed files with 48 additions and 22 deletions
+3
View File
@@ -1,12 +1,15 @@
import { httpFetch } from '../../request'
import { headers, timeout } from '../options'
import { getHostIp } from '../utils'
const api_temp = {
getMusicUrl(songInfo, type) {
const ip = getHostIp('tm.tempmusic.tk')
const requestObj = httpFetch(`http://tm.tempmusic.tk/url/kw/${songInfo.songmid}/${type}`, {
method: 'get',
headers,
timeout,
host: ip,
family: 4,
})
requestObj.promise = requestObj.promise.then(({ body }) => {