Skip to content

Commit a59b83e

Browse files
committed
将配置文件单独放,方便升级版本时迁移
1 parent d6a0f85 commit a59b83e

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
.DS_Store
33
/music/
44
musiclist.json
5-
node_modules
5+
node_modules
6+
config.js

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ HeoMusic支持URL参数 `https://music.zhheo.com/?id=`+ id +`&server=` + server
9595

9696
**鸡你太美:** https://music.zhheo.com/?id=2762963245&server=netease
9797

98-
## 修改HTML的方法(适用于在线音乐和本地音乐)
98+
## 修改配置的方法(适用于在线音乐和本地音乐)
9999

100-
编辑`index.html`的相关代码,填写歌单id和服务商
100+
`config.js.demo`文件重命名为`config.js`,并修改其中的配置
101101

102102
![修改id和server](/img/help.webp)
103103

config.js.demo

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
var userId = "8668419170";
2+
var userServer = "tencent";
3+
var userType = "playlist";
4+
var localMusic = [{
5+
name: '重生之我在异乡为异客',
6+
artist: '王睿卓',
7+
url: '/music/重生之我在异乡为异客.mp3',
8+
cover: '/music/重生之我在异乡为异客.png',
9+
lrc: '/music/重生之我在异乡为异客.lrc'
10+
},
11+
{
12+
name: '落',
13+
artist: '唐伯虎',
14+
url: '/music/落.mp3',
15+
cover: '/music/落.png',
16+
lrc: '/music/落.lrc'
17+
}
18+
];
19+
var remoteMusic = "./musiclist.json"

index.html

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,7 @@
1919
<body>
2020
<div id="heoMusic-page">
2121
</div>
22-
<script>
23-
var userId = "8668419170";
24-
var userServer = "tencent";
25-
var userType = "playlist";
26-
// var localMusic = [{
27-
// name: '重生之我在异乡为异客',
28-
// artist: '王睿卓',
29-
// url: '/music/重生之我在异乡为异客.mp3',
30-
// cover: '/music/重生之我在异乡为异客.png',
31-
// lrc: '/music/重生之我在异乡为异客.lrc'
32-
// },
33-
// {
34-
// name: '落',
35-
// artist: '唐伯虎',
36-
// url: '/music/落.mp3',
37-
// cover: '/music/落.png',
38-
// lrc: '/music/落.lrc'
39-
// }
40-
// ];
41-
// var remoteMusic = "./musiclist.json"
42-
</script>
22+
<script src="./config.js"></script>
4323
<script src="./js/APlayer.min.js"></script>
4424
<script async data-pjax src="./js/main.js"></script>
4525
</body>

0 commit comments

Comments
 (0)