From c9b88574a2b1337b081460846e40fbabafa23c30 Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Thu, 8 May 2025 19:40:02 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.production | 8 ++++++++ .env.staging | 5 +++++ main.js | 18 +++++++++--------- package.json | 1 + 4 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 .env.production create mode 100644 .env.staging diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..83c205b --- /dev/null +++ b/.env.production @@ -0,0 +1,8 @@ +VITE_OJ=https://oj.xuyue.cc +VITE_CODE=https://code.xuyue.cc +VITE_WEB=https://web.xuyue.cc +VITE_PLAY=https://play.xuyue.cc +VITE_BOOK=https://book.xuyue.cc +VITE_HUABU=https://huabu.xuyue.cc +VITE_PPT=https://ppt.xuyue.cc/py +VITE_PY=https://python.xuyue.cc \ No newline at end of file diff --git a/.env.staging b/.env.staging new file mode 100644 index 0000000..e12d358 --- /dev/null +++ b/.env.staging @@ -0,0 +1,5 @@ +VITE_OJ=http://10.13.114.214:81 +VITE_CODE=http://10.13.114.214:82 +# VITE_PLAY=http://10.13.114.214:83 +VITE_BOOK=http://10.13.114.214:84 +VITE_HUABU=http://10.13.114.214:85 \ No newline at end of file diff --git a/main.js b/main.js index 3855e7e..d947f24 100644 --- a/main.js +++ b/main.js @@ -21,46 +21,46 @@ const pins = [ const sites = [ { - url: "https://oj.xuyue.cc", + url: import.meta.env.VITE_OJ, title: "判题狗", description: "在线判题网站", }, { - url: "https://code.xuyue.cc", + url: import.meta.env.VITE_CODE, title: "自测猫", description: "代码运行网站", }, { - url: "https://web.xuyue.cc", + url: import.meta.env.VITE_WEB, title: "AI x Web", description: "AI x Web 新势力", }, { - url: "https://play.xuyue.cc", + url: import.meta.env.VITE_PLAY, title: "限时鸭", description: "用来练习基本的代码格式", }, { - url: "https://book.xuyue.cc", + url: import.meta.env.VITE_BOOK, title: "编程书", description: "编程和计算机相关知识汇总", }, { - url: "https://huabu.xuyue.cc", + url: import.meta.env.VITE_HUABU, title: "白板", description: "在线板书", }, { - url: "https://ppt.xuyue.cc/py", + url: import.meta.env.VITE_PPT, title: "Python PPT", description: "Python 第一学期上课用", }, { - url: "https://python.xuyue.cc", + url: import.meta.env.VITE_PY, title: "Python 项目", description: "Python 第二学期上课用", }, -] +].filter(i => !!i.url) const item = (site) => ` diff --git a/package.json b/package.json index 2e5977f..ed0271e 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "scripts": { "start": "vite", "build": "vite build", + "build:staging": "vite build --mode=staging", "fmt": "prettier --write *.js style.css index.html" }, "devDependencies": {