From 0fe8bfc6aa89f77553648575ef72c68bac525761 Mon Sep 17 00:00:00 2001 From: wood chen Date: Sat, 22 Feb 2025 15:41:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=8B=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E7=AB=AF=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/()/page.tsx | 16 ++++++++-------- src/components/ui/code-block.tsx | 14 +++++++++++--- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/app/()/page.tsx b/src/app/()/page.tsx index 8257c2f..cdd060e 100644 --- a/src/app/()/page.tsx +++ b/src/app/()/page.tsx @@ -148,7 +148,7 @@ export default function HomePage() {
- + 接入应用 (授权码模式) @@ -159,7 +159,7 @@ export default function HomePage() { 适用于有后端服务器的应用。 - + @@ -202,7 +202,7 @@ export default function HomePage() { 请求地址 - + GET https://connect.q58.club/oauth/authorize @@ -229,7 +229,7 @@ window.location.href = authUrl;`}

用户授权后,将重定向到您的回调地址:

-
+                                
                                   
                                     https://your-app.com/callback?code=ac_xxxxxx...
                                   
@@ -267,7 +267,7 @@ window.location.href = authUrl;`}
                             
                               
                               请求地址
-                              
+                              
                                 POST
                                 https://connect.q58.club/api/oauth/access_token
                               
@@ -294,7 +294,7 @@ window.location.href = authUrl;`}
                               
                               响应数据
                               
-                                
+                                
                                   
                                     {`{
   "access_token": "at_xxxxxxxx",  // 访问令牌
@@ -328,7 +328,7 @@ window.location.href = authUrl;`}
                             
                               
                               请求地址
-                              
+                              
                                 GET https://connect.q58.club/api/oauth/user
                               
                             
@@ -348,7 +348,7 @@ window.location.href = authUrl;`}
                               
                               响应数据
                               
-                                
+                                
                                   
                                     {`{
   "id": "user_xxx",           // 用户唯一标识
diff --git a/src/components/ui/code-block.tsx b/src/components/ui/code-block.tsx
index e1f7724..a4459f0 100644
--- a/src/components/ui/code-block.tsx
+++ b/src/components/ui/code-block.tsx
@@ -3,6 +3,8 @@
 import { useState } from "react";
 import { Check, Copy } from "lucide-react";
 
+import { cn } from "@/lib/utils";
+
 function CopyButton({ text }: { text: string }) {
   const [copied, setCopied] = useState(false);
 
@@ -26,10 +28,16 @@ function CopyButton({ text }: { text: string }) {
   );
 }
 
-export function CodeBlock({ children }: { children: string }) {
+export function CodeBlock({
+  children,
+  className,
+}: {
+  children: string;
+  className?: string;
+}) {
   return (
-    
-
+    
+
         {children}