修正fetch单词的拼写错误

This commit is contained in:
lyswhut
2019-09-22 10:08:37 +08:00
parent 58e61e0bda
commit bebf1906a2
20 changed files with 59 additions and 72 deletions
+2 -2
View File
@@ -1,10 +1,10 @@
import { httpFatch } from '../../request'
import { httpFetch } from '../../request'
import { requestMsg } from '../../message'
import { headers, timeout } from '../options'
const api_test = {
getMusicUrl(songInfo, type) {
const requestObj = httpFatch(`http://ts.tempmusic.tk/url/bd/${songInfo.songmid}/${type}`, {
const requestObj = httpFetch(`http://ts.tempmusic.tk/url/bd/${songInfo.songmid}/${type}`, {
method: 'get',
timeout,
headers,
+2 -2
View File
@@ -2,7 +2,7 @@ import leaderboard from './leaderboard'
import api_source from '../api-source'
import musicInfo from './musicInfo'
import songList from './songList'
import { httpFatch } from '../../request'
import { httpFetch } from '../../request'
import musicSearch from './musicSearch'
const bd = {
@@ -19,7 +19,7 @@ const bd = {
},
getLyric(songInfo) {
const requestObj = this.getMusicInfo(songInfo)
requestObj.promise = requestObj.promise.then(info => httpFatch(info.lrclink).promise.then(resp => resp.body))
requestObj.promise = requestObj.promise.then(info => httpFetch(info.lrclink).promise.then(resp => resp.body))
return requestObj
},
// getLyric(songInfo) {
+2 -2
View File
@@ -1,4 +1,4 @@
import { httpFatch } from '../../request'
import { httpFetch } from '../../request'
// import { formatPlayTime } from '../../index'
// import jshtmlencode from 'js-htmlencode'
@@ -66,7 +66,7 @@ export default {
requestObj: null,
getData(url) {
if (this.requestObj) this.requestObj.cancelHttp()
this.requestObj = httpFatch(url)
this.requestObj = httpFetch(url)
return this.requestObj.promise
},
filterData(rawList) {
+2 -2
View File
@@ -1,4 +1,4 @@
import { httpFatch } from '../../request'
import { httpFetch } from '../../request'
export default {
cache: {},
@@ -6,7 +6,7 @@ export default {
if (this.cache[songmid]) {
return { promise: Promise.resolve(this.cache[songmid]) }
}
const requestObj = httpFatch(`https://musicapi.qianqian.com/v1/restserver/ting?method=baidu.ting.song.getSongLink&format=json&from=bmpc&version=1.0.0&version_d=11.1.6.0&songid=${songmid}&type=1&res=1&s_protocol=1&aac=2&project=tpass`)
const requestObj = httpFetch(`https://musicapi.qianqian.com/v1/restserver/ting?method=baidu.ting.song.getSongLink&format=json&from=bmpc&version=1.0.0&version_d=11.1.6.0&songid=${songmid}&type=1&res=1&s_protocol=1&aac=2&project=tpass`)
requestObj.promise = requestObj.promise.then(({ body }) => {
// console.log(body)
if (body.error_code == 22000) {
+2 -2
View File
@@ -1,6 +1,6 @@
// import '../../polyfill/array.find'
// import jshtmlencode from 'js-htmlencode'
import { httpFatch } from '../../request'
import { httpFetch } from '../../request'
import { formatPlayTime } from '../../index'
// import { debug } from '../../utils/env'
// import { formatSinger } from './util'
@@ -13,7 +13,7 @@ export default {
allPage: 1,
musicSearch(str, page) {
if (searchRequest && searchRequest.cancelHttp) searchRequest.cancelHttp()
searchRequest = httpFatch(`http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=5.6.5.6&method=baidu.ting.search.merge&format=json&query=${encodeURIComponent(str)}&page_no=${page}&page_size=${this.limit}&type=0&data_source=0&use_cluster=1`)
searchRequest = httpFetch(`http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=5.6.5.6&method=baidu.ting.search.merge&format=json&query=${encodeURIComponent(str)}&page_no=${page}&page_size=${this.limit}&type=0&data_source=0&use_cluster=1`)
return searchRequest.promise.then(({ body }) => body)
},
handleResult(rawData) {
+4 -4
View File
@@ -1,4 +1,4 @@
import { httpFatch } from '../../request'
import { httpFetch } from '../../request'
import { formatPlayTime, toMD5 } from '../../index'
import CryptoJS from 'crypto-js'
@@ -110,7 +110,7 @@ export default {
// 获取标签
getTags() {
if (this._requestObj_tags) this._requestObj_tags.cancelHttp()
this._requestObj_tags = httpFatch(this.getTagsUrl())
this._requestObj_tags = httpFetch(this.getTagsUrl())
return this._requestObj_tags.promise.then(({ body }) => {
if (body.error_code !== this.successCode) return this.getTags()
return {
@@ -143,7 +143,7 @@ export default {
// 获取列表数据
getList(sortId, tagId, page) {
if (this._requestObj_list) this._requestObj_list.cancelHttp()
this._requestObj_list = httpFatch(
this._requestObj_list = httpFetch(
this.getListUrl(sortId, tagId, page)
)
return this._requestObj_list.promise.then(({ body }) => {
@@ -187,7 +187,7 @@ export default {
if (this._requestObj_listDetail) {
this._requestObj_listDetail.cancelHttp()
}
this._requestObj_listDetail = httpFatch(this.getListDetailUrl(id, page))
this._requestObj_listDetail = httpFetch(this.getListDetailUrl(id, page))
return this._requestObj_listDetail.promise.then(({ body }) => {
if (body.error_code !== this.successCode) return this.getListDetail(id, page)
let listData = this.filterData(body.result.songlist)