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,