Skip to content

Commit

Permalink
修复外链地址问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zhheo committed May 29, 2024
1 parent 4a32e5a commit 03e1134
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions js/localEngine.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
var encodedLocalMusic = localMusic.map(item => ({
name: item.name,
artist: item.artist,
url: encodeURIComponent(item.url),
cover: encodeURIComponent(item.cover),
lrc: encodeURIComponent(item.lrc)
url: encodeNonAscii(item.url),
cover: encodeNonAscii(item.cover),
lrc: encodeNonAscii(item.lrc)
}));

document.getElementById('heoMusic-page').classList.add('localMusic');

function encodeNonAscii(str) {
return str.replace(/[^\x00-\x7F]/g, function(c) {
return encodeURIComponent(c);
});
}

const ap = new APlayer({
container: document.getElementById('heoMusic-page'),
lrcType: 3,
Expand Down
2 changes: 1 addition & 1 deletion js/localEngine.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 03e1134

Please sign in to comment.