feat: 添加生产环境配置,重构 API 请求,更新部署脚本和配置

This commit is contained in:
richarjiang
2026-03-15 23:00:51 +08:00
parent 3c35f1982f
commit 441cc8dd48
14 changed files with 131 additions and 20 deletions

View File

@@ -1,7 +1,10 @@
import { createAuthClient } from 'better-auth/react'
const basePath = process.env.NEXT_PUBLIC_BASE_PATH || '/studio'
const appUrl = process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3001'
export const authClient = createAuthClient({
baseURL: process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000',
baseURL: `${appUrl}${basePath}/api/auth`,
})
export const { signIn, signOut, useSession } = authClient