发布0.3.5版本

This commit is contained in:
lyswhut
2019-08-30 13:11:02 +08:00
parent 1786376a9e
commit c81c33a430
18 changed files with 124 additions and 110 deletions
+2 -2
View File
@@ -185,7 +185,7 @@ export const updateSetting = setting => {
},
themeId: 0,
sourceId: 'kw',
apiSource: 'temp',
apiSource: 'test',
randomAnimate: true,
ignoreVersion: null,
}
@@ -202,7 +202,7 @@ export const updateSetting = setting => {
objectDeepMerge(defaultSetting, overwriteSetting)
setting = defaultSetting
}
if (setting.apiSource == 'messoer') setting.apiSource = 'temp' // 强制设置回 temp 接口源
if (setting.apiSource != 'test') setting.apiSource = 'test' // 强制设置回 test 接口源
return setting
}
+20 -20
View File
@@ -1,26 +1,26 @@
import kw_api_temp from './kw/api-temp'
// import kw_api_messoer from './kw/api-messoer'
import kw_api_test from './kw/api-test'
// import tx_api_messoer from './tx/api-messoer'
// import kg_api_messoer from './kg/api-messoer'
// import wy_api_messoer from './wy/api-messoer'
// import bd_api_messoer from './bd/api-messoer'
import kw_api_internal from './kw/api-internal'
import tx_api_internal from './tx/api-internal'
import kg_api_internal from './kg/api-internal'
import wy_api_internal from './wy/api-internal'
import bd_api_internal from './bd/api-internal'
import kg_api_test from './kg/api-test'
import wy_api_test from './wy/api-test'
import bd_api_test from './bd/api-test'
// import kw_api_internal from './kw/api-internal'
// import tx_api_internal from './tx/api-internal'
// import kg_api_internal from './kg/api-internal'
// import wy_api_internal from './wy/api-internal'
// import bd_api_internal from './bd/api-internal'
const apis = {
// kw_api_messoer,
kw_api_test,
// tx_api_messoer,
// kg_api_messoer,
// wy_api_messoer,
// bd_api_messoer,
kw_api_internal,
tx_api_internal,
kg_api_internal,
wy_api_internal,
bd_api_internal,
kg_api_test,
wy_api_test,
bd_api_test,
// kw_api_internal,
// tx_api_internal,
// kg_api_internal,
// wy_api_internal,
// bd_api_internal,
kw_api_temp,
}
@@ -29,8 +29,8 @@ const getAPI = source => {
switch (window.globalObj.apiSource) {
// case 'messoer':
// return apis[`${source}_api_messoer`]
case 'internal':
return apis[`${source}_api_internal`]
case 'test':
return apis[`${source}_api_test`]
case 'temp':
return apis[`${source}_api_temp`]
}
@@ -1,10 +1,10 @@
import { httpFatch } from '../../request'
import { requestMsg } from '../../message'
import { headers, timeout } from '../messoer'
import { headers, timeout } from '../options'
const api_messoer = {
const api_test = {
getMusicUrl(songInfo, type) {
const requestObj = httpFatch(`https://v1.itooi.cn/baidu/url?id=${songInfo.songmid}&quality=${type.replace(/k$/, '')}&isRedirect=0`, {
const requestObj = httpFatch(`http://45.32.53.128:3000/baidu/url?id=${songInfo.songmid}&quality=${type.replace(/k$/, '')}`, {
method: 'get',
timeout,
headers,
@@ -15,7 +15,7 @@ const api_messoer = {
return requestObj
},
getPic(songInfo, size = '500') {
const requestObj = httpFatch(`https://v1.itooi.cn/baidu/pic?id=${songInfo.songmid}&imageSize=${size}&isRedirect=0`, {
const requestObj = httpFatch(`http://45.32.53.128:3000/baidu/pic?id=${songInfo.songmid}&imageSize=${size}`, {
method: 'get',
timeout,
headers,
@@ -26,7 +26,7 @@ const api_messoer = {
return requestObj
},
getLyric(songInfo) {
const requestObj = httpFatch(`https://v1.itooi.cn/baidu/lrc?id=${songInfo.songmid}&isRedirect=0`, {
const requestObj = httpFatch(`http://45.32.53.128:3000/baidu/lrc?id=${songInfo.songmid}`, {
method: 'get',
timeout,
headers,
@@ -38,4 +38,4 @@ const api_messoer = {
},
}
export default api_messoer
export default api_test
@@ -1,10 +1,10 @@
import { httpFatch } from '../../request'
import { requestMsg } from '../../message'
import { headers, timeout } from '../messoer'
import { headers, timeout } from '../options'
const api_messoer = {
const api_test = {
getMusicUrl(songInfo, type) {
const requestObj = httpFatch(`https://v1.itooi.cn/kugou/url?id=${songInfo._types[type].hash}&quality=${type.replace(/k$/, '')}&isRedirect=0`, {
const requestObj = httpFatch(`http://45.32.53.128:3000/kugou/url?id=${songInfo._types[type].hash}&quality=${type.replace(/k$/, '')}`, {
method: 'get',
timeout,
headers,
@@ -15,7 +15,7 @@ const api_messoer = {
return requestObj
},
getPic(songInfo) {
const requestObj = httpFatch(`https://v1.itooi.cn/kugou/pic?id=${songInfo.hash}&isRedirect=0`, {
const requestObj = httpFatch(`http://45.32.53.128:3000/kugou/pic?id=${songInfo.hash}`, {
method: 'get',
timeout,
headers,
@@ -26,7 +26,7 @@ const api_messoer = {
return requestObj
},
getLyric(songInfo) {
const requestObj = httpFatch(`https://v1.itooi.cn/kugou/lrc?id=${songInfo.hash}&isRedirect=0`, {
const requestObj = httpFatch(`http://45.32.53.128:3000/kugou/lrc?id=${songInfo.hash}`, {
method: 'get',
timeout,
headers,
@@ -38,4 +38,4 @@ const api_messoer = {
},
}
export default api_messoer
export default api_test
@@ -1,30 +0,0 @@
import { httpFatch } from '../../request'
import { requestMsg } from '../../message'
import { headers, timeout } from '../messoer'
const api_messoer = {
getMusicUrl(songInfo, type) {
const requestObj = httpFatch(`https://v1.itooi.cn/kuwo/url?id=${songInfo.songmid}&quality=${type.replace(/k$/, '')}&isRedirect=0`, {
method: 'get',
timeout,
headers,
})
requestObj.promise = requestObj.promise.then(({ body }) => {
return body.code === 200 ? Promise.resolve({ type, url: body.data }) : Promise.reject(new Error(requestMsg.fail))
})
return requestObj
},
getPic(songInfo) {
const requestObj = httpFatch(`https://v1.itooi.cn/kuwo/pic?id=${songInfo.songmid}&isRedirect=0`, {
method: 'get',
timeout,
headers,
})
requestObj.promise = requestObj.promise.then(({ body }) => {
return body.code === 200 ? Promise.resolve(body.data) : Promise.reject(new Error(requestMsg.fail))
})
return requestObj
},
}
export default api_messoer
+30
View File
@@ -0,0 +1,30 @@
import { httpFatch } from '../../request'
import { requestMsg } from '../../message'
import { headers, timeout } from '../options'
const api_test = {
// getMusicUrl(songInfo, type) {
// const requestObj = httpFatch(`http://45.32.53.128:3002/m/kw/u/${songInfo.songmid}/${type}`, {
// method: 'get',
// headers,
// timeout,
// })
// requestObj.promise = requestObj.promise.then(({ body }) => {
// return body.code === 0 ? Promise.resolve({ type, url: body.data }) : Promise.reject(new Error(body.msg))
// })
// return requestObj
// },
getMusicUrl(songInfo, type) {
const requestObj = httpFatch(`http://45.32.53.128:3000/kuwo/url?id=${songInfo.songmid}&quality=${type.replace(/k$/, '')}`, {
method: 'get',
timeout,
headers,
})
requestObj.promise = requestObj.promise.then(({ body }) => {
return body.code === 200 ? Promise.resolve({ type, url: body.data }) : Promise.reject(new Error(requestMsg.fail))
})
return requestObj
},
}
export default api_test
@@ -4,7 +4,7 @@ import { headers, timeout } from '../messoer'
const api_messoer = {
getMusicUrl(songInfo, type) {
const requestObj = httpFatch(`https://v1.itooi.cn/tencent/url?id=${songInfo.strMediaMid}&quality=${type.replace(/k$/, '')}&isRedirect=0`, {
const requestObj = httpFatch(`https://v1.itooi.cn/tencent/url?id=${songInfo.strMediaMid}&quality=${type.replace(/k$/, '')}`, {
method: 'get',
timeout,
headers,
@@ -1,10 +1,10 @@
import { httpFatch } from '../../request'
import { requestMsg } from '../../message'
import { headers, timeout } from '../messoer'
import { headers, timeout } from '../options'
const api_messoer = {
const api_test = {
getMusicUrl(songInfo, type) {
const requestObj = httpFatch(`https://v1.itooi.cn/netease/url?id=${songInfo.songmid}&quality=${type.replace(/k$/, '')}&isRedirect=0`, {
const requestObj = httpFatch(`http://45.32.53.128:3000/netease/url?id=${songInfo.songmid}&quality=${type.replace(/k$/, '')}`, {
method: 'get',
timeout,
headers,
@@ -15,7 +15,7 @@ const api_messoer = {
return requestObj
},
getPic(songInfo) {
const requestObj = httpFatch(`https://v1.itooi.cn/netease/pic?id=${songInfo.songmid}&isRedirect=0`, {
const requestObj = httpFatch(`http://45.32.53.128:3000/netease/pic?id=${songInfo.songmid}`, {
method: 'get',
timeout,
headers,
@@ -26,7 +26,7 @@ const api_messoer = {
return requestObj
},
getLyric(songInfo) {
const requestObj = httpFatch(`https://v1.itooi.cn/netease/lrc?id=${songInfo.songmid}&isRedirect=0`, {
const requestObj = httpFatch(`http://45.32.53.128:3000/netease/lrc?id=${songInfo.songmid}`, {
method: 'get',
timeout,
headers,
@@ -38,4 +38,4 @@ const api_messoer = {
},
}
export default api_messoer
export default api_test