fix: 用户不存在时前端提示错误;修正微信支付图标;beta compose 改用 Docker Hub 镜像

This commit is contained in:
erio
2026-03-02 01:05:01 +08:00
parent c6815fc2a3
commit 85239e97f8
3 changed files with 19 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
services: services:
app: app:
image: sub2apipay:latest image: touwaeriol/sub2apipay:${IMAGE_TAG:-latest}
container_name: sub2apipay container_name: sub2apipay
ports: ports:
- '8087:3000' - '8087:3000'

View File

@@ -59,6 +59,7 @@ function PayContent() {
maxAmount: 1000, maxAmount: 1000,
maxDailyAmount: 0, maxDailyAmount: 0,
}); });
const [userNotFound, setUserNotFound] = useState(false);
const effectiveUserId = resolvedUserId || userId; const effectiveUserId = resolvedUserId || userId;
const isEmbedded = uiMode === 'embedded' && isIframeContext; const isEmbedded = uiMode === 'embedded' && isIframeContext;
@@ -100,6 +101,9 @@ function PayContent() {
methodLimits: cfgData.config.methodLimits, methodLimits: cfgData.config.methodLimits,
}); });
} }
} else if (cfgRes.status === 404) {
setUserNotFound(true);
return;
} }
// 有 token 时才尝试获取用户详情和订单 // 有 token 时才尝试获取用户详情和订单
@@ -183,6 +187,17 @@ function PayContent() {
); );
} }
if (userNotFound) {
return (
<div className={`flex min-h-screen items-center justify-center p-4 ${isDark ? 'bg-slate-950' : 'bg-slate-50'}`}>
<div className="text-center text-red-500">
<p className="text-lg font-medium"></p>
<p className="mt-2 text-sm text-gray-500"></p>
</div>
</div>
);
}
const buildScopedUrl = (path: string, forceOrdersTab = false) => { const buildScopedUrl = (path: string, forceOrdersTab = false) => {
const params = new URLSearchParams(); const params = new URLSearchParams();
if (effectiveUserId) params.set('user_id', String(effectiveUserId)); if (effectiveUserId) params.set('user_id', String(effectiveUserId));

View File

@@ -94,14 +94,9 @@ export default function PaymentForm({
if (type === 'wxpay') { if (type === 'wxpay') {
return ( return (
<span className="flex h-8 w-8 items-center justify-center rounded-full bg-[#2BB741] text-white"> <span className="flex h-8 w-8 items-center justify-center rounded-full bg-[#2BB741] text-white">
<svg viewBox="0 0 24 24" className="h-5 w-5" fill="none"> <svg viewBox="0 0 24 24" className="h-5 w-5" fill="currentColor">
<path <path d="M10 3C6.13 3 3 5.58 3 8.75c0 1.7.84 3.23 2.17 4.29l-.5 2.21 2.4-1.32c.61.17 1.25.27 1.93.27.22 0 .43-.01.64-.03C9.41 13.72 9 12.88 9 12c0-3.31 3.13-6 7-6 .26 0 .51.01.76.03C15.96 3.98 13.19 3 10 3z" />
d="M5 12.5 10.2 17 19 8" <path d="M16 8c-3.31 0-6 2.24-6 5s2.69 5 6 5c.67 0 1.31-.1 1.9-.28l2.1 1.15-.55-2.44C20.77 15.52 22 13.86 22 12c0-2.21-2.69-4-6-4z" />
stroke="currentColor"
strokeWidth="2.4"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg> </svg>
</span> </span>
); );