You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
unblock-music-web/src/App.vue

86 lines
3.2 KiB
Vue

5 years ago
<template>
5 years ago
<el-container id="app">
<el-main>
4 years ago
<Home/>
5 years ago
</el-main>
<el-footer id="app-footer">
<el-row>
4 years ago
<a href="https://github.com/ix64/unlock-music" target="_blank">音乐解锁</a>({{ version }})
移除已购音乐的加密保护
5 years ago
<a href="https://github.com/ix64/unlock-music/wiki/使用提示" target="_blank">使用提示</a>
</el-row>
<el-row>
4 years ago
目前支持网易云音乐(ncm), QQ音乐(qmc, mflac, mgg), 酷狗音乐(kgm), 虾米音乐(xm), 酷我音乐(.kwm)
<a href="https://github.com/ix64/unlock-music/blob/master/README.md" target="_blank">更多</a>
5 years ago
</el-row>
<el-row>
4 years ago
<!--如果进行二次开发此行版权信息不得移除且应明显地标注于页面上-->
<span>Copyright &copy; 2019 - {{ (new Date()).getFullYear() }} MengYX</span>
5 years ago
音乐解锁使用
<a href="https://github.com/ix64/unlock-music/blob/master/LICENSE" target="_blank">MIT许可协议</a>
5 years ago
开放源代码
5 years ago
</el-row>
</el-footer>
</el-container>
5 years ago
</template>
<script>
5 years ago
4 years ago
import FileSelector from "@/component/FileSelector"
import PreviewTable from "@/component/PreviewTable"
import config from "@/../package.json"
import Home from "@/view/Home";
import {checkUpdate} from "@/utils/api";
export default {
name: 'app',
components: {
FileSelector,
4 years ago
PreviewTable,
Home
},
data() {
return {
version: config.version,
}
},
created() {
4 years ago
this.$nextTick(() => this.finishLoad());
},
methods: {
async finishLoad() {
const mask = document.getElementById("loader-mask");
if (!!mask) mask.remove();
let updateInfo;
try {
4 years ago
updateInfo = await checkUpdate(this.version)
} catch (e) {
4 years ago
console.warn("check version info failed", e)
}
4 years ago
if ((updateInfo && process.env.NODE_ENV === 'production') && (updateInfo.HttpsFound ||
(updateInfo.Found && window.location.protocol !== "https:"))) {
this.$notify.warning({
title: '发现更新',
4 years ago
message: `发现新版本 v${updateInfo.Version}<br/>更新详情:${updateInfo.Detail}<br/> <a target="_blank" href="${updateInfo.URL}">获取更新</a>`,
dangerouslyUseHTMLString: true,
duration: 15000,
position: 'top-left'
});
} else {
this.$notify.info({
title: '离线使用',
4 years ago
message: `我们使用PWA技术无网络也能使用<br/>最近更新:${config.updateInfo}<br/><a target="_blank" href="https://github.com/ix64/unlock-music/wiki/使用提示">使用提示</a>`,
5 years ago
dangerouslyUseHTMLString: true,
duration: 10000,
position: 'top-left'
5 years ago
});
}
}
},
}
5 years ago
</script>
<style lang="scss">
@import "scss/unlock-music";
5 years ago
</style>