Просмотр исходного кода

📝 docs(config): 添加环境配置文件并更新项目基础路径

- 新增开发环境配置文件 `.env.development`,包含 API 基础 URL 和版本号
- 新增生产环境配置文件 `.env.production`,包含生产环境 API 配置占位符
- 更新 H5 配置中的 `publicPath` 和 `router.basename` 为 `/mini-talent`,确保资源路径正确
yourname 3 недель назад
Родитель
Сommit
c09cecce2c
3 измененных файлов с 15 добавлено и 2 удалено
  1. 7 0
      mini-talent/.env.development
  2. 6 0
      mini-talent/.env.production
  3. 2 2
      mini-talent/config/index.ts

+ 7 - 0
mini-talent/.env.development

@@ -0,0 +1,7 @@
+# 配置文档参考 https://taro-docs.jd.com/docs/next/env-mode-config
+# TARO_APP_ID="开发环境下的小程序 AppID"
+
+# API配置
+# 需换成当前项目的
+TARO_APP_API_BASE_URL=https://d8d-ai-vscode-8080-188-179-template-6-group.r.d8d.fun
+TARO_APP_API_VERSION=v1

+ 6 - 0
mini-talent/.env.production

@@ -0,0 +1,6 @@
+# 生产环境配置
+# TARO_APP_ID="生产环境下的小程序 AppID"
+
+# API配置
+API_BASE_URL=https://your-domain.com
+API_VERSION=v1

+ 2 - 2
mini-talent/config/index.ts

@@ -84,7 +84,7 @@ export default defineConfig<'webpack5'>(async (merge, { command, mode }) => {
       }
     },
     h5: {
-      publicPath: '/mini/',
+      publicPath: '/mini-talent/',
       staticDirectory: 'static',
       output: {
         filename: 'js/[name].[hash:8].js',
@@ -119,7 +119,7 @@ export default defineConfig<'webpack5'>(async (merge, { command, mode }) => {
         chain.resolve.plugin('tsconfig-paths').use(TsconfigPathsPlugin)
       },
       router: {
-        basename: '/mini',
+        basename: '/mini-talent',
       },
     },
     rn: {