音乐播放
This commit is contained in:
parent
674f67f5e5
commit
7d5f8a5288
@ -27,22 +27,39 @@ const data = reactive({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
// if (import.meta.env.VITE_APP_ENV != "development") {
|
// 8834041785
|
||||||
const res = await $http.file.listMusic();
|
const res = await fetch("http://met.hxyouzi.com/meting-api/?server=tencent&type=playlist&id=8834041785")
|
||||||
data.audio = [];
|
const mlist = await res.json()
|
||||||
res.data.forEach(i => {
|
data.audio = []
|
||||||
let name = i.split(".")[0];
|
mlist.forEach(i => {
|
||||||
let t = name.split("-");
|
|
||||||
let mid = name + "/"+ name
|
|
||||||
data.audio.push({
|
data.audio.push({
|
||||||
title: t[1],
|
title: i.name,
|
||||||
author: t[0],
|
author: i.artist,
|
||||||
url: res.baseUrl + mid +'.mp3',
|
url: i.url,
|
||||||
pic: res.baseUrl + mid + ".jpg",
|
pic: i.pic,
|
||||||
lrc: res.baseUrl + mid + ".lrc",
|
lrc: i.lrc,
|
||||||
});
|
});
|
||||||
console.log('>>>>>',data.audio);
|
console.log('>>>>>',data.audio);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// if (import.meta.env.VITE_APP_ENV != "development") {
|
||||||
|
// const res = await $http.file.listMusic();
|
||||||
|
// data.audio = [];
|
||||||
|
// res.data.forEach(i => {
|
||||||
|
// let name = i.split(".")[0];
|
||||||
|
// let t = name.split("-");
|
||||||
|
// let mid = name + "/"+ name
|
||||||
|
// data.audio.push({
|
||||||
|
// title: t[1],
|
||||||
|
// author: t[0],
|
||||||
|
// url: res.baseUrl + mid +'.mp3',
|
||||||
|
// pic: res.baseUrl + mid + ".jpg",
|
||||||
|
// lrc: res.baseUrl + mid + ".lrc",
|
||||||
|
// });
|
||||||
|
// console.log('>>>>>',data.audio);
|
||||||
|
|
||||||
|
// });
|
||||||
// } else {
|
// } else {
|
||||||
// const d = {
|
// const d = {
|
||||||
// title: "南屏晚钟",
|
// title: "南屏晚钟",
|
||||||
|
Loading…
Reference in New Issue
Block a user