-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
33 lines (33 loc) · 978 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var app = new Vue({
el : "#player",
data : {
message : "",
cover : "",
album : "",
link : "",
get_music : false
},
methods: {
sub : function() {
var that = this
axios.get('https://api.paugram.com/netease/?id=' + this.message)
.then(function(response){
console.log(response.data.album)
if(!response.data.album){
alert("找不到这个歌")
}else{
that.cover = response.data.cover;
that.album = response.data.title;
that.link = response.data.link;
that.get_music = true;
that.message = "";
}
})
.catch(function(err){
that.get_music = false;
console.log(err);
alert("没这个歌儿哦");
});
},
}
})