's'
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
# 可用 ngrok 等隧道:BASE_URL=https://xxx.ngrok.io
|
# 可用 ngrok 等隧道:BASE_URL=https://xxx.ngrok.io
|
||||||
# 或直接使用生产地址测试回调(需 payjsapi 已部署到公网)
|
# 或直接使用生产地址测试回调(需 payjsapi 已部署到公网)
|
||||||
PORT=8007
|
PORT=8007
|
||||||
BASE_URL=https://api.nomadyt.com
|
BASE_URL=https://salonapi.hackrobot.cn
|
||||||
|
|
||||||
# 支付渠道:zpay | xorpay
|
# 支付渠道:zpay | xorpay
|
||||||
PAYMENT_PROVIDER=zpay
|
PAYMENT_PROVIDER=zpay
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
## 环境
|
## 环境
|
||||||
|
|
||||||
本地调试:`BASE_URL` 需为 ZPAY 可访问地址(如 ngrok 暴露 8700 端口)
|
本地调试:`BASE_URL` 需为 ZPAY 可访问地址(如 ngrok 暴露 8700 端口)
|
||||||
线上部署:`BASE_URL=https://api.nomadyt.com`
|
线上部署:`BASE_URL=https://salonapi.hackrobot.cn`
|
||||||
|
|
||||||
## 模块结构
|
## 模块结构
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ python run.py
|
|||||||
|
|
||||||
## 线上部署
|
## 线上部署
|
||||||
|
|
||||||
域名:`https://api.nomadyt.com`
|
域名:`https://salonapi.hackrobot.cn`
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# .env 中设置
|
# .env 中设置
|
||||||
@@ -86,9 +86,9 @@ PAYMENT_PROVIDER=zpay
|
|||||||
|
|
||||||
本地正常、Ubuntu 部署后 api.hackrobot.cn 调用支付失败,常见原因:
|
本地正常、Ubuntu 部署后 api.hackrobot.cn 调用支付失败,常见原因:
|
||||||
|
|
||||||
1. **BASE_URL 配置错误**:必须为 ZPAY 可公网访问的地址。错误示例:`http://127.0.0.1:8700`、`http://localhost`。正确:`https://api.nomadyt.com`(域名需解析到本机,nginx 反向代理对应端口)。
|
1. **BASE_URL 配置错误**:必须为 ZPAY 可公网访问的地址。错误示例:`http://127.0.0.1:8700`、`http://localhost`。正确:`https://salonapi.hackrobot.cn`(域名需解析到本机,nginx 反向代理对应端口)。
|
||||||
|
|
||||||
2. **服务器无法访问 zpayz.cn**:防火墙、DNS 或网络限制。访问 `https://api.nomadyt.com/health?check_zpay=1` 自检:
|
2. **服务器无法访问 zpayz.cn**:防火墙、DNS 或网络限制。访问 `https://salonapi.hackrobot.cn/health?check_zpay=1` 自检:
|
||||||
- `zpayz_reachable: false` → 开放出站或检查网络
|
- `zpayz_reachable: false` → 开放出站或检查网络
|
||||||
- `zpayz_error` 含 "SSL" → 执行 `apt install ca-certificates` 后重启
|
- `zpayz_error` 含 "SSL" → 执行 `apt install ca-certificates` 后重启
|
||||||
|
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ MEMOS_TOKEN = os.getenv(
|
|||||||
"eyJhbGciOiJIUzI1NiIsImtpZCI6InYxIiwidHlwIjoiSldUIn0.eyJuYW1lIjoiaGFja3JvYm90IiwiaXNzIjoibWVtb3MiLCJzdWIiOiIxIiwiYXVkIjpbInVzZXIuYWNjZXNzLXRva2VuIl0sImlhdCI6MTc1NzQwNTE0OX0.Idn7kBlxE-CoSOXwWuZ1tHGIRKHAIeDyXSafGS5OHsg",
|
"eyJhbGciOiJIUzI1NiIsImtpZCI6InYxIiwidHlwIjoiSldUIn0.eyJuYW1lIjoiaGFja3JvYm90IiwiaXNzIjoibWVtb3MiLCJzdWIiOiIxIiwiYXVkIjpbInVzZXIuYWNjZXNzLXRva2VuIl0sImlhdCI6MTc1NzQwNTE0OX0.Idn7kBlxE-CoSOXwWuZ1tHGIRKHAIeDyXSafGS5OHsg",
|
||||||
)
|
)
|
||||||
|
|
||||||
# 回调地址(用于生成 notify_url)。salon 线上部署 api.nomadyt.com
|
# 回调地址(用于生成 notify_url)。线上 https://salonapi.hackrobot.cn
|
||||||
BASE_URL = os.getenv("BASE_URL", "https://api.nomadyt.com")
|
BASE_URL = os.getenv("BASE_URL", "https://salonapi.hackrobot.cn")
|
||||||
|
|
||||||
# MinIO 对象存储
|
# MinIO 对象存储
|
||||||
MINIO_ENDPOINT = os.getenv("MINIO_ENDPOINT", "minioweb.hackrobot.cn")
|
MINIO_ENDPOINT = os.getenv("MINIO_ENDPOINT", "minioweb.hackrobot.cn")
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ salon API 主入口
|
|||||||
- /api/salon/* 报名、check-user、ensure-user、complete-order、join、volunteers、xiaohongshu/profile
|
- /api/salon/* 报名、check-user、ensure-user、complete-order、join、volunteers、xiaohongshu/profile
|
||||||
|
|
||||||
本地调试:BASE_URL 需为 ZPAY 可访问地址(如 ngrok)
|
本地调试:BASE_URL 需为 ZPAY 可访问地址(如 ngrok)
|
||||||
线上部署:BASE_URL=https://api.nomadyt.com(必须为 ZPAY 可公网访问的地址)
|
线上部署:BASE_URL=https://salonapi.hackrobot.cn(必须为 ZPAY 可公网访问的地址)
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
@@ -92,7 +92,7 @@ def _check_base_url():
|
|||||||
return
|
return
|
||||||
if "localhost" in url or "127.0.0.1" in url or url.startswith("http://192.168.") or url.startswith("http://10."):
|
if "localhost" in url or "127.0.0.1" in url or url.startswith("http://192.168.") or url.startswith("http://10."):
|
||||||
logging.warning(
|
logging.warning(
|
||||||
"BASE_URL=%s 疑似内网地址,ZPAY 无法回调!线上部署请设置 BASE_URL 为公网地址,如 https://api.nomadyt.com",
|
"BASE_URL=%s 疑似内网地址,ZPAY 无法回调!线上部署请设置 BASE_URL 为公网地址,如 https://salonapi.hackrobot.cn",
|
||||||
BASE_URL,
|
BASE_URL,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user