添加配置项
This commit is contained in:
parent
8f46b8dd46
commit
ddda08c037
6
.env
6
.env
@ -1,8 +1,14 @@
|
||||
# 站点名称
|
||||
VITE_SITE_NAME = "無名の主页"
|
||||
VITE_SITE_ANTHOR = "無名"
|
||||
VITE_SITE_KEYWORDS = "無名,个人主页"
|
||||
VITE_SITE_DES = "一个默默无闻的主页"
|
||||
VITE_SITE_URL = "imsyy.top"
|
||||
VITE_SITE_LOGO = "/images/icon/logo.png"
|
||||
|
||||
# 百度统计(若不需要可不填)
|
||||
VITE_SITE_BAIDUTONGJI = "14e9f35ff8bc67fd4bcb5f07a6e6655a"
|
||||
|
||||
# 简介文本
|
||||
VITE_DESC_HELLO = "Hello World !"
|
||||
VITE_DESC_TEXT = "一个建立于 21 世纪的小站,存活于互联网的边缘"
|
||||
|
@ -40,6 +40,9 @@
|
||||
* 在 `终端` 中输入:
|
||||
|
||||
```bash
|
||||
# 安装 yarn
|
||||
npm install -g yarn
|
||||
|
||||
# 安装依赖
|
||||
yarn install
|
||||
|
||||
|
10
index.html
10
index.html
@ -6,9 +6,9 @@
|
||||
<meta http-equiv="Access-Control-Allow-Origin" content="*">
|
||||
<!-- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="一个默默无闻的主页" />
|
||||
<meta name="keywords" content="無名,个人主页" />
|
||||
<meta name="author" content="無名" />
|
||||
<meta name="description" content="<%- description %>" />
|
||||
<meta name="keywords" content="<%- keywords %>" />
|
||||
<meta name="author" content="<%- author %>" />
|
||||
<meta name="theme-color" content="#424242" />
|
||||
<title><%- title %></title>
|
||||
<!-- HarmonyOS Sans -->
|
||||
@ -24,16 +24,18 @@
|
||||
window.location.href =
|
||||
"https://support.dmeng.net/upgrade-your-browser.html?referrer=" + encodeURIComponent(window.location.href)
|
||||
</script>
|
||||
<% if (tongji) { %>
|
||||
<!-- 百度统计 -->
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
(function () {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?14e9f35ff8bc67fd4bcb5f07a6e6655a";
|
||||
hm.src = "https://hm.baidu.com/hm.js?<%- tongji %>";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
<% } %>
|
||||
</head>
|
||||
|
||||
<body class="loading">
|
||||
|
@ -18,9 +18,14 @@
|
||||
"icon": "/images/icon/email.png",
|
||||
"tip": "来封 Email ~",
|
||||
"url": "mailto:one@imsyy.top"
|
||||
}, {
|
||||
"name": "Twitter",
|
||||
"icon": "/images/icon/twitter.png",
|
||||
"tip": "你懂的 ~",
|
||||
"url": "https://twitter.com/iimmsyy"
|
||||
}, {
|
||||
"name": "Telegram",
|
||||
"icon": "/images/icon/telegram.png",
|
||||
"tip": "你懂的 ~",
|
||||
"url": "https://twitter.com/iimmsyy"
|
||||
"url": "https://t.me/bottom_user"
|
||||
}]
|
@ -114,13 +114,6 @@ onMounted(() => {
|
||||
playListCount.value = res.length;
|
||||
// 更改播放器加载状态
|
||||
store.musicIsOk = true;
|
||||
console.log(
|
||||
"音乐加载完成",
|
||||
res,
|
||||
playIndex.value,
|
||||
playListCount.value,
|
||||
props.volume
|
||||
);
|
||||
// 生成歌单
|
||||
res.forEach((v) => {
|
||||
playList.value.push({
|
||||
@ -131,6 +124,13 @@ onMounted(() => {
|
||||
lrc: v.lrc,
|
||||
});
|
||||
});
|
||||
console.log(
|
||||
"音乐加载完成",
|
||||
playList.value,
|
||||
playIndex.value,
|
||||
playListCount.value,
|
||||
props.volume
|
||||
);
|
||||
})
|
||||
.catch(() => {
|
||||
store.musicIsOk = false;
|
||||
@ -214,7 +214,7 @@ const changeSong = (type) => {
|
||||
defineExpose({ playToggle, changeVolume, changeSong });
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
<style lang="scss" scoped>
|
||||
.aplayer {
|
||||
width: 80%;
|
||||
background: transparent;
|
||||
|
@ -15,3 +15,10 @@ pinia.use(piniaPluginPersistedstate);
|
||||
|
||||
app.use(pinia);
|
||||
app.mount('#app')
|
||||
|
||||
// PWA
|
||||
navigator.serviceWorker.addEventListener('controllerchange', () => {
|
||||
// 弹出更新提醒
|
||||
console.log("站点已更新,刷新后生效");
|
||||
ElMessage("站点已更新,刷新后生效");
|
||||
})
|
@ -36,6 +36,10 @@ export default ({
|
||||
inject: {
|
||||
data: {
|
||||
title: loadEnv(mode, process.cwd()).VITE_SITE_NAME,
|
||||
author: loadEnv(mode, process.cwd()).VITE_SITE_ANTHOR,
|
||||
keywords: loadEnv(mode, process.cwd()).VITE_SITE_KEYWORDS,
|
||||
description: loadEnv(mode, process.cwd()).VITE_SITE_DES,
|
||||
tongji: loadEnv(mode, process.cwd()).VITE_SITE_BAIDUTONGJI,
|
||||
},
|
||||
},
|
||||
}),
|
||||
@ -46,6 +50,8 @@ export default ({
|
||||
navigateFallbackAllowlist: [/^index.html$/]
|
||||
},
|
||||
workbox: {
|
||||
skipWaiting: true,
|
||||
clientsClaim: true,
|
||||
runtimeCaching: [{
|
||||
urlPattern: /(.*?)\.(js|css|woff2|woff|ttf)/, // js / css 静态资源缓存
|
||||
handler: 'CacheFirst',
|
||||
@ -63,9 +69,9 @@ export default ({
|
||||
],
|
||||
},
|
||||
manifest: {
|
||||
"name": "無名の主页",
|
||||
"short_name": "無名の主页",
|
||||
"description": "一个默默无闻的主页",
|
||||
"name": loadEnv(mode, process.cwd()).VITE_SITE_NAME,
|
||||
"short_name": loadEnv(mode, process.cwd()).VITE_SITE_NAME,
|
||||
"description": loadEnv(mode, process.cwd()).VITE_SITE_DES,
|
||||
"display": "standalone",
|
||||
"start_url": "/",
|
||||
"theme_color": "#424242",
|
||||
|
Loading…
Reference in New Issue
Block a user