-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
306 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
### 新增 | ||
|
||
- 新增音乐来源切换,可到设置页面-基本设置 look look ! | ||
- 为搜索结果列表添加多选功能。 | ||
P.S:暂时没想好多选后的操作按钮放哪... | ||
|
||
### 优化 | ||
|
||
- 重构checkbox组件 | ||
- 重构与改进checkbox组件,使其支持不定选中状态 | ||
- 完善上一个版本的http请求封装并切换部分请求到该方法上 | ||
- 优化其他一些细节 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import kw_api_messoer from './kw/api-messoer' | ||
import kw_api_temp from './kw/api-temp' | ||
import tx_api_messoer from './tx/api-messoer' | ||
|
||
const apis = { | ||
kw_api_messoer, | ||
tx_api_messoer, | ||
kw_api_temp, | ||
} | ||
|
||
|
||
const getAPI = source => { | ||
switch (window.globalObj.apiSource) { | ||
case 'messoer': | ||
return apis[`${source}_api_messoer`] | ||
case 'temp': | ||
return apis[`${source}_api_temp`] | ||
} | ||
} | ||
|
||
export default source => { | ||
switch (source) { | ||
case 'tx': | ||
return getAPI('tx') | ||
default: | ||
return getAPI('kw') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { httpFatch } from '../../request' | ||
|
||
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: 5000, | ||
}) | ||
requestObj.promise = requestObj.promise.then(({ body }) => { | ||
return body.code === 200 ? Promise.resolve({ type, url: body.data }) : Promise.reject(new Error(body.msg)) | ||
}) | ||
return requestObj | ||
}, | ||
getPic(songInfo) { | ||
const requestObj = httpFatch(`https://v1.itooi.cn/kuwo/pic?id=${songInfo.songmid}&isRedirect=0`, { | ||
method: 'get', | ||
timeout: 5000, | ||
}) | ||
requestObj.promise = requestObj.promise.then(({ body }) => { | ||
return body.code === 200 ? Promise.resolve(body.data) : Promise.reject(new Error(body.msg)) | ||
}) | ||
return requestObj | ||
}, | ||
} | ||
|
||
export default api_messoer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { httpFatch } from '../../request' | ||
|
||
const api_temp = { | ||
getMusicUrl(songInfo, type) { | ||
const requestObj = httpFatch(`https://www.stsky.cn/api/temp/getMusicUrl.php?id=${songInfo.songmid}&type=${type}`, { | ||
method: 'get', | ||
}) | ||
requestObj.promise = requestObj.promise.then(({ body }) => { | ||
return body.code === 0 ? Promise.resolve({ type, url: body.data }) : Promise.reject(new Error(body.msg)) | ||
}).catch(err => { | ||
console.log(err) | ||
if (err.message === 'socket hang up') return Promise.reject(new Error('接口挂了')) | ||
if (err.code === 'ENOTFOUND') return Promise.reject(new Error('无法连接网络')) | ||
return Promise.reject(err) | ||
}) | ||
return requestObj | ||
}, | ||
getPic(songInfo) { | ||
const requestObj = httpFatch(`https://www.stsky.cn/api/temp/getPic.php?size=320&songmid=${songInfo.songmid}`, { | ||
method: 'get', | ||
}) | ||
requestObj.promise = requestObj.promise.then(({ body }) => { | ||
return body.code === 0 ? Promise.resolve(body.data) : Promise.reject(new Error(body.msg)) | ||
}).catch(err => { | ||
if (err.message === 'socket hang up') return Promise.reject(new Error('接口挂了')) | ||
if (err.code === 'ENOTFOUND') return Promise.reject(new Error('无法连接网络')) | ||
return Promise.reject(err) | ||
}) | ||
return requestObj | ||
}, | ||
} | ||
|
||
export default api_temp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.