refactor(sdk): musicSdk 全量迁移至 TypeScript
This commit is contained in:
1 parent
f289df4cd7
commit
1dfb7a59ca
83 files changed
+924
-732
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import leaderboard from './leaderboard.ts'
|
||||
import lyric from './lyric.ts'
|
||||
import songList from './songList.ts'
|
||||
import musicSearch from './musicSearch.ts'
|
||||
import { apis } from '../api-source.ts'
|
||||
import hotSearch from './hotSearch.ts'
|
||||
import comment from './comment.ts'
|
||||
// import tipSearch from './tipSearch.ts'
|
||||
|
||||
const tx = {
|
||||
// tipSearch,
|
||||
leaderboard,
|
||||
songList,
|
||||
musicSearch,
|
||||
hotSearch,
|
||||
comment,
|
||||
|
||||
getMusicUrl(songInfo, type) {
|
||||
return apis('tx')!.getMusicUrl(songInfo, type)
|
||||
},
|
||||
getLyric(songInfo) {
|
||||
// let singer = songInfo.singer.indexOf('、') > -1 ? songInfo.singer.split('、')[0] : songInfo.singer
|
||||
return lyric.getLyric(songInfo)
|
||||
},
|
||||
async getPic(songInfo) {
|
||||
return `https://y.gtimg.cn/music/photo_new/T002R500x500M000${songInfo.albumId}.jpg`
|
||||
},
|
||||
getMusicDetailPageUrl(songInfo) {
|
||||
return `https://y.qq.com/n/yqq/song/${songInfo.songmid}.html`
|
||||
},
|
||||
}
|
||||
|
||||
export default tx
|
||||
Reference in new issue
Block a user