配置 Nginx 反向代理和 Ngrok 内网穿透支持
- 添加 Nginx 反向代理配置(支持 ngrok 域名) - 创建统一的 API 工具函数(自动适配域名) - 更新前端 API 配置支持相对路径 - 配置支付宝回调地址使用 ngrok URL - 优化 Docker Compose 配置(仅暴露 80 端口) - 添加完整的部署和配置文档
This commit is contained in:
@@ -148,8 +148,11 @@ const getEmailCode = async () => {
|
||||
}
|
||||
|
||||
try {
|
||||
// 导入 API 工具函数
|
||||
const { buildApiURL } = await import('@/utils/apiHelper')
|
||||
|
||||
// 调用后端API发送邮箱验证码
|
||||
const response = await fetch('http://localhost:8080/api/verification/email/send', {
|
||||
const response = await fetch(buildApiURL('/verification/email/send'), {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
@@ -177,7 +180,8 @@ const getEmailCode = async () => {
|
||||
|
||||
// 开发模式:将验证码同步到后端
|
||||
try {
|
||||
await fetch('http://localhost:8080/api/verification/email/dev-set', {
|
||||
const { buildApiURL } = await import('@/utils/apiHelper')
|
||||
await fetch(buildApiURL('/verification/email/dev-set'), {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
@@ -239,9 +243,12 @@ const handleLogin = async () => {
|
||||
|
||||
let result
|
||||
|
||||
// 导入 API 工具函数
|
||||
const { buildApiURL } = await import('@/utils/apiHelper')
|
||||
|
||||
// 邮箱验证码登录
|
||||
try {
|
||||
const response = await fetch('http://localhost:8080/api/auth/login/email', {
|
||||
const response = await fetch(buildApiURL('/auth/login/email'), {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
||||
Reference in New Issue
Block a user