diff --git a/.npmrc b/.npmrc index 8df4d17..7549542 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1 @@ -http-proxy=http://localhost:10808 -registry=https://registry.npmmirror.com \ No newline at end of file +registry=https://registry.npmmirror.com diff --git a/Dockerfile b/Dockerfile index 4015c94..df2df4e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,10 @@ -FROM oven/bun:1.2.19-alpine AS base +FROM oven/bun:1.3.2-alpine AS base # 依赖缓存阶段 FROM base AS deps WORKDIR /app -COPY package.json bun.lock ./ -RUN bun config set registry https://registry.npmmirror.com +COPY package.json bun.lock .npmrc ./ RUN bun install --frozen-lockfile # 构建阶段 diff --git a/src/app/(api)/proxies/route.ts b/src/app/(api)/proxies/route.ts index 65115ca..aaf7597 100644 --- a/src/app/(api)/proxies/route.ts +++ b/src/app/(api)/proxies/route.ts @@ -2,9 +2,8 @@ import {NextRequest, NextResponse} from 'next/server' import {createChannels} from '@/actions/channel' export async function GET(req: NextRequest) { + const params = req.nextUrl.searchParams try { - const params = req.nextUrl.searchParams - const resource_id = params.get('i') if (!resource_id) { throw new Error('需要指定资源ID') diff --git a/src/app/(auth)/login/login-card.tsx b/src/app/(auth)/login/login-card.tsx index c2b7d4d..3745c2b 100644 --- a/src/app/(auth)/login/login-card.tsx +++ b/src/app/(auth)/login/login-card.tsx @@ -15,8 +15,7 @@ import {toast} from 'sonner' import {useRouter} from 'next/navigation' import {login, LoginMode} from '@/actions/auth' import {useProfileStore} from '@/components/stores/profile' -import SendMsg from '@/components/send-msg' -import '@cap.js/widget' +import dynamic from 'next/dynamic' const smsSchema = zod.object({ username: zod.string().length(11, '请输入正确的手机号码'), @@ -211,3 +210,5 @@ function SendMsgByUsername() { const phone = useWatch({control, name: 'username'}) return } + +const SendMsg = dynamic(() => import('@/components/send-msg'), {ssr: false}) diff --git a/src/app/admin/(dashboard)/_client/userCenter.tsx b/src/app/admin/(dashboard)/_client/userCenter.tsx index a3978c3..d2f6a1b 100644 --- a/src/app/admin/(dashboard)/_client/userCenter.tsx +++ b/src/app/admin/(dashboard)/_client/userCenter.tsx @@ -11,7 +11,7 @@ import actionBill from '../_assets/action-bill.webp' import actionBuy from '../_assets/action-buy.webp' import actionLogout from '../_assets/action-logout.webp' -async function UserCenter() { +export default async function UserCenter() { const resp = await getProfile() if (!resp.success) { return ( @@ -90,4 +90,3 @@ async function UserCenter() { ) } -export default UserCenter diff --git a/src/app/admin/profile/layout.tsx b/src/app/admin/profile/layout.tsx index 84de683..14d2760 100644 --- a/src/app/admin/profile/layout.tsx +++ b/src/app/admin/profile/layout.tsx @@ -1,4 +1,4 @@ -import {ReactNode} from 'react' +import {ReactNode, Suspense} from 'react' import {Metadata} from 'next' export async function generateMetadata(): Promise { @@ -12,5 +12,5 @@ export type ProfileLayoutProps = { } export default async function ProfileLayout(props: ProfileLayoutProps) { - return props.children + return {props.children} } diff --git a/src/app/callback/sftpay/page.tsx b/src/app/callback/sftpay/page.tsx deleted file mode 100644 index 2790cd7..0000000 --- a/src/app/callback/sftpay/page.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import {ReactNode} from 'react' - -export type SftpayPageProps = { - -} - -export default async function SftpayPage(props: SftpayPageProps) { - return ( -
-
-
-
-
- - - -
-
-

支付成功

-

- 您的订单已成功支付,感谢您的使用 -

-
- -
-
-
-
-
订单编号
-
ORD-12345678
-
-
-
支付金额
-
¥ 299.00
-
-
-
支付时间
-
{new Date().toLocaleString('zh-CN')}
-
-
-
支付方式
-
SFT支付
-
-
-
- -
- -
-
-
-
- ) -} diff --git a/src/components/composites/dialogs/change-password-dialog.tsx b/src/components/composites/dialogs/change-password-dialog.tsx index f1cd92f..2729bea 100644 --- a/src/components/composites/dialogs/change-password-dialog.tsx +++ b/src/components/composites/dialogs/change-password-dialog.tsx @@ -10,7 +10,7 @@ import * as z from 'zod' import {toast} from 'sonner' import {useRouter} from 'next/navigation' import {updatePassword} from '@/actions/user' -import SendMsg from '@/components/send-msg' +import dynamic from 'next/dynamic' // 表单验证规则 const schema = z.object({ @@ -158,3 +158,5 @@ function SendMsgByPhone() { const phone = useWatch({control, name: 'phone'}) return } + +const SendMsg = dynamic(() => import('@/components/send-msg'), {ssr: false})