From bdafd407d7c7e89182dfedc72c16297b9a8379c4 Mon Sep 17 00:00:00 2001 From: c0dedance <2627702283@qq.com> Date: Sat, 30 Dec 2023 23:56:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E5=8A=A0=E8=BD=BDACCESS=5FTOKEN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.template | 1 + docs/rpress.config.ts | 4 ++-- src/node/cli.ts | 8 +++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.env.template b/.env.template index 327efd5..57a7ed6 100644 --- a/.env.template +++ b/.env.template @@ -1 +1,2 @@ +# 填入你的ACCESS_TOKEN 并保存为.env.local VITE_ACCESS_TOKEN=YOUR_ACCESS_TOKEN \ No newline at end of file diff --git a/docs/rpress.config.ts b/docs/rpress.config.ts index d76d044..1067a6d 100644 --- a/docs/rpress.config.ts +++ b/docs/rpress.config.ts @@ -62,8 +62,8 @@ export default defineConfig({ // root: '.', include: ['./**/*.{md,mdx}'], server: { - ask: '/ask', - upload: '/upload', + ask: 'https://dkb2jv5y9f.us.aircode.run/ask', + upload: 'https://dkb2jv5y9f.us.aircode.run/upload', }, } }) diff --git a/src/node/cli.ts b/src/node/cli.ts index 77154cb..bccf9ca 100644 --- a/src/node/cli.ts +++ b/src/node/cli.ts @@ -61,11 +61,9 @@ cli try { root = path.resolve(root) const config = await resolveConfig(root, 'build', 'production') - // load env - const { VITE_ACCESS_TOKEN: accessToken } = loadEnv( - 'production', - process.cwd() - ) + // load env 支持.env文件、环境变量 + const { VITE_ACCESS_TOKEN: accessToken = process.env.ACCESS_TOKEN } = + loadEnv('production', process.cwd()) await upload({ root,