|
|
@ -2,7 +2,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
<el-container id="app">
|
|
|
|
<el-container id="app">
|
|
|
|
<el-main>
|
|
|
|
<el-main>
|
|
|
|
<x-upload v-on:handle_error="showFail" v-on:handle_finish="showSuccess"></x-upload>
|
|
|
|
<file-selector @error="showFail" @success="showSuccess"/>
|
|
|
|
|
|
|
|
|
|
|
|
<div id="app-control">
|
|
|
|
<div id="app-control">
|
|
|
|
<el-row class="mb-3">
|
|
|
|
<el-row class="mb-3">
|
|
|
@ -28,14 +28,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
<audio :autoplay="playing_auto" :src="playing_url" controls/>
|
|
|
|
<audio :autoplay="playing_auto" :src="playing_url" controls/>
|
|
|
|
|
|
|
|
|
|
|
|
<x-preview :download_format="download_format" :table-data="tableData"
|
|
|
|
<PreviewTable :filename_format="download_format" :table-data="tableData"
|
|
|
|
v-on:music_changed="changePlaying"></x-preview>
|
|
|
|
@music_changed="changePlaying"></PreviewTable>
|
|
|
|
|
|
|
|
|
|
|
|
</el-main>
|
|
|
|
</el-main>
|
|
|
|
<el-footer id="app-footer">
|
|
|
|
<el-footer id="app-footer">
|
|
|
|
<el-row>
|
|
|
|
<el-row>
|
|
|
|
<a href="https://github.com/ix64/unlock-music" target="_blank">音乐解锁</a>(v<span
|
|
|
|
<a href="https://github.com/ix64/unlock-music" target="_blank">音乐解锁</a>
|
|
|
|
v-text="version"></span>):移除已购音乐的加密保护。
|
|
|
|
(v{{ version }}):移除已购音乐的加密保护。
|
|
|
|
<a href="https://github.com/ix64/unlock-music/wiki/使用提示" target="_blank">使用提示</a>
|
|
|
|
<a href="https://github.com/ix64/unlock-music/wiki/使用提示" target="_blank">使用提示</a>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-row>
|
|
|
@ -44,7 +44,7 @@
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-row>
|
|
|
|
<!--如果进行二次开发,此行版权信息不得移除且应明显地标注于页面上-->
|
|
|
|
<!--如果进行二次开发,此行版权信息不得移除且应明显地标注于页面上-->
|
|
|
|
<span>Copyright © 2019-</span><span v-text="(new Date()).getFullYear()"></span> MengYX
|
|
|
|
<span>Copyright © 2019 - {{ (new Date()).getFullYear() }} MengYX</span>
|
|
|
|
音乐解锁使用
|
|
|
|
音乐解锁使用
|
|
|
|
<a href="https://github.com/ix64/unlock-music/blob/master/LICENSE" target="_blank">MIT许可协议</a>
|
|
|
|
<a href="https://github.com/ix64/unlock-music/blob/master/LICENSE" target="_blank">MIT许可协议</a>
|
|
|
|
开放源代码
|
|
|
|
开放源代码
|
|
|
@ -56,50 +56,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
|
|
import upload from "./component/upload"
|
|
|
|
import FileSelector from "./component/FileSelector"
|
|
|
|
import preview from "./component/preview"
|
|
|
|
import PreviewTable from "./component/PreviewTable"
|
|
|
|
import {DownloadBlobMusic, RemoveBlobMusic} from "./component/util"
|
|
|
|
import {DownloadBlobMusic, RemoveBlobMusic} from "./component/utils"
|
|
|
|
import config from "../package"
|
|
|
|
import config from "../package"
|
|
|
|
import {IXAREA_API_ENDPOINT} from "@/decrypt/utils";
|
|
|
|
import {IXAREA_API_ENDPOINT} from "@/decrypt/utils";
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: 'app',
|
|
|
|
name: 'app',
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
xUpload: upload,
|
|
|
|
FileSelector,
|
|
|
|
xPreview: preview
|
|
|
|
PreviewTable
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
version: config.version,
|
|
|
|
version: config.version,
|
|
|
|
activeIndex: '1',
|
|
|
|
activeIndex: '1',
|
|
|
|
tableData: [],
|
|
|
|
tableData: [],
|
|
|
|
playing_url: "",
|
|
|
|
playing_url: "",
|
|
|
|
playing_auto: false,
|
|
|
|
playing_auto: false,
|
|
|
|
download_format: '1',
|
|
|
|
download_format: '1',
|
|
|
|
instant_download: false,
|
|
|
|
instant_download: false,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
created() {
|
|
|
|
|
|
|
|
this.$nextTick(function () {
|
|
|
|
|
|
|
|
this.finishLoad();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
async finishLoad() {
|
|
|
|
|
|
|
|
const mask = document.getElementById("loader-mask");
|
|
|
|
|
|
|
|
if (!!mask) mask.remove();
|
|
|
|
|
|
|
|
let updateInfo;
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const resp = await fetch(IXAREA_API_ENDPOINT + "/music/app-version", {
|
|
|
|
|
|
|
|
method: "POST", headers: {"Content-Type": "application/json"},
|
|
|
|
|
|
|
|
body: JSON.stringify({"Version": this.version})
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
updateInfo = await resp.json();
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
if ((!!updateInfo && process.env.NODE_ENV === 'production') && (!!updateInfo.HttpsFound ||
|
|
|
|
created() {
|
|
|
|
(!!updateInfo.Found && window.location.protocol !== "https:"))) {
|
|
|
|
this.$nextTick(function () {
|
|
|
|
this.$notify.warning({
|
|
|
|
this.finishLoad();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
async finishLoad() {
|
|
|
|
|
|
|
|
const mask = document.getElementById("loader-mask");
|
|
|
|
|
|
|
|
if (!!mask) mask.remove();
|
|
|
|
|
|
|
|
let updateInfo;
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const resp = await fetch(IXAREA_API_ENDPOINT + "/music/app-version", {
|
|
|
|
|
|
|
|
method: "POST", headers: {"Content-Type": "application/json"},
|
|
|
|
|
|
|
|
body: JSON.stringify({"Version": this.version})
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
updateInfo = await resp.json();
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((!!updateInfo && process.env.NODE_ENV === 'production') && (!!updateInfo.HttpsFound ||
|
|
|
|
|
|
|
|
(!!updateInfo.Found && window.location.protocol !== "https:"))) {
|
|
|
|
|
|
|
|
this.$notify.warning({
|
|
|
|
|
|
|
|
title: '发现更新',
|
|
|
|
title: '发现更新',
|
|
|
|
message: '发现新版本 v' + updateInfo.Version +
|
|
|
|
message: '发现新版本 v' + updateInfo.Version +
|
|
|
|
'<br/>更新详情:' + updateInfo.Detail +
|
|
|
|
'<br/>更新详情:' + updateInfo.Detail +
|
|
|
@ -107,78 +107,74 @@
|
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
|
duration: 15000,
|
|
|
|
duration: 15000,
|
|
|
|
position: 'top-left'
|
|
|
|
position: 'top-left'
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.$notify.info({
|
|
|
|
this.$notify.info({
|
|
|
|
title: '离线使用',
|
|
|
|
title: '离线使用',
|
|
|
|
message: '我们使用PWA技术,无网络也能使用' +
|
|
|
|
message: '我们使用PWA技术,无网络也能使用' +
|
|
|
|
'<br/>最近更新:' + config.updateInfo +
|
|
|
|
'<br/>最近更新:' + config.updateInfo +
|
|
|
|
'<br/><a target="_blank" href="https://github.com/ix64/unlock-music/wiki/使用提示">使用提示</a>',
|
|
|
|
'<br/><a target="_blank" href="https://github.com/ix64/unlock-music/wiki/使用提示">使用提示</a>',
|
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
|
|
|
|
|
duration: 10000,
|
|
|
|
|
|
|
|
position: 'top-left'
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
showSuccess(data) {
|
|
|
|
|
|
|
|
if (data.status) {
|
|
|
|
|
|
|
|
if (this.instant_download) {
|
|
|
|
|
|
|
|
DownloadBlobMusic(data, this.download_format);
|
|
|
|
|
|
|
|
RemoveBlobMusic(data);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.tableData.push(data);
|
|
|
|
|
|
|
|
this.$notify.success({
|
|
|
|
|
|
|
|
title: '解锁成功',
|
|
|
|
|
|
|
|
message: '成功解锁 ' + data.title,
|
|
|
|
|
|
|
|
duration: 3000
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
|
|
|
|
|
|
let _rp_data = [data.title, data.artist, data.album];
|
|
|
|
|
|
|
|
window._paq.push(["trackEvent", "Unlock", data.rawExt + "," + data.mime, JSON.stringify(_rp_data)]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.showFail(data.message, data.rawFilename + "." + data.rawExt)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
showFail(errInfo, filename) {
|
|
|
|
|
|
|
|
this.$notify.error({
|
|
|
|
|
|
|
|
title: '出现问题',
|
|
|
|
|
|
|
|
message: errInfo + "," + filename +
|
|
|
|
|
|
|
|
',参考<a target="_blank" href="https://github.com/ix64/unlock-music/wiki/使用提示">使用提示</a>',
|
|
|
|
|
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
|
duration: 6000
|
|
|
|
duration: 10000,
|
|
|
|
|
|
|
|
position: 'top-left'
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
|
|
}
|
|
|
|
window._paq.push(["trackEvent", "Error", errInfo, filename]);
|
|
|
|
},
|
|
|
|
}
|
|
|
|
showSuccess(data) {
|
|
|
|
console.error(errInfo, filename);
|
|
|
|
if (this.instant_download) {
|
|
|
|
},
|
|
|
|
DownloadBlobMusic(data, this.download_format);
|
|
|
|
changePlaying(url) {
|
|
|
|
RemoveBlobMusic(data);
|
|
|
|
this.playing_url = url;
|
|
|
|
} else {
|
|
|
|
this.playing_auto = true;
|
|
|
|
this.tableData.push(data);
|
|
|
|
},
|
|
|
|
this.$notify.success({
|
|
|
|
handleDeleteAll() {
|
|
|
|
title: '解锁成功',
|
|
|
|
this.tableData.forEach(value => {
|
|
|
|
message: '成功解锁 ' + data.title,
|
|
|
|
RemoveBlobMusic(value);
|
|
|
|
duration: 3000
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.tableData = [];
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handleDownloadAll() {
|
|
|
|
|
|
|
|
let index = 0;
|
|
|
|
|
|
|
|
let c = setInterval(() => {
|
|
|
|
|
|
|
|
if (index < this.tableData.length) {
|
|
|
|
|
|
|
|
DownloadBlobMusic(this.tableData[index], this.download_format);
|
|
|
|
|
|
|
|
index++;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
clearInterval(c);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, 300);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
|
|
|
|
|
|
let _rp_data = [data.title, data.artist, data.album];
|
|
|
|
|
|
|
|
window._paq.push(["trackEvent", "Unlock", data.rawExt + "," + data.mime, JSON.stringify(_rp_data)]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
showFail(errInfo, filename) {
|
|
|
|
|
|
|
|
this.$notify.error({
|
|
|
|
|
|
|
|
title: '出现问题',
|
|
|
|
|
|
|
|
message: errInfo + "," + filename +
|
|
|
|
|
|
|
|
',参考<a target="_blank" href="https://github.com/ix64/unlock-music/wiki/使用提示">使用提示</a>',
|
|
|
|
|
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
|
|
|
|
|
duration: 6000
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
|
|
|
|
|
|
window._paq.push(["trackEvent", "Error", errInfo, filename]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
console.error(errInfo, filename);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
changePlaying(url) {
|
|
|
|
|
|
|
|
this.playing_url = url;
|
|
|
|
|
|
|
|
this.playing_auto = true;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handleDeleteAll() {
|
|
|
|
|
|
|
|
this.tableData.forEach(value => {
|
|
|
|
|
|
|
|
RemoveBlobMusic(value);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.tableData = [];
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
handleDownloadAll() {
|
|
|
|
|
|
|
|
let index = 0;
|
|
|
|
|
|
|
|
let c = setInterval(() => {
|
|
|
|
|
|
|
|
if (index < this.tableData.length) {
|
|
|
|
|
|
|
|
DownloadBlobMusic(this.tableData[index], this.download_format);
|
|
|
|
|
|
|
|
index++;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
clearInterval(c);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, 300);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
<style lang="scss">
|
|
|
|
@import "scss/unlock-music";
|
|
|
|
@import "scss/unlock-music";
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|