微信小程序端修改config服务器地址配置
This commit is contained in:
@@ -9,8 +9,11 @@
|
||||
pnpm --filter @dukang/mini-user dev
|
||||
# → http://localhost:5177
|
||||
|
||||
# 微信小程序
|
||||
# 微信小程序(本地联调,development)
|
||||
pnpm --filter @dukang/mini-user dev:weapp
|
||||
|
||||
# 微信小程序(生产构建 → API: https://api.dukanghaoke.com)
|
||||
pnpm build:mini-user:weapp
|
||||
# 用微信开发者工具打开 apps/mini-user(miniprogramRoot = dist/)
|
||||
```
|
||||
|
||||
@@ -18,7 +21,7 @@ pnpm --filter @dukang/mini-user dev:weapp
|
||||
|
||||
| 环节 | 文件 | 说明 |
|
||||
|------|------|------|
|
||||
| **编译注入** | `config/index.ts` → `defineConstants.TARO_APP_API_ORIGIN` | 本地默认 `http://localhost:3000`;`NODE_ENV=production` 默认 `https://api.dukanghaoke.com`;可用 `VITE_API_TARGET` 覆盖 |
|
||||
| **编译注入** | `config/index.ts` → `defineConstants.TARO_APP_API_ORIGIN` | `dev:weapp` / watch → `localhost:3000`;`build:weapp`(`--mode production`)→ `https://api.dukanghaoke.com`;可用 `VITE_API_TARGET` 覆盖 |
|
||||
| **运行时拼装** | `src/lib/api.ts` → `resolveApiBase()` | `{origin}/api/v1` |
|
||||
|
||||
### 微信登录 `invalid code`
|
||||
|
||||
Reference in New Issue
Block a user