diff --git a/README.md b/README.md index 8af32f4..3b14277 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ pnpm turbo ### 1. 授权请求 -**端点:** `https://connect.q58.pro/oauth/authorize` +**端点:** `https://connect.q58.club/oauth/authorize` **方法:** GET @@ -93,7 +93,7 @@ pnpm turbo ### 2. 获取访问令牌 -**端点:** `https://connect.q58.pro/api/oauth/access_token` +**端点:** `https://connect.q58.club/api/oauth/access_token` **方法:** POST @@ -114,7 +114,7 @@ pnpm turbo ### 3. 获取用户信息 -**端点:** `https://connect.q58.pro/api/oauth/user` +**端点:** `https://connect.q58.club/api/oauth/user` **方法:** GET diff --git a/next.config.mjs b/next.config.mjs index d2d7411..bb24c9f 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -6,7 +6,7 @@ const nextConfig = { remotePatterns: [ { protocol: "https", - hostname: "q58.pro", + hostname: "q58.club", }, { protocol: "https", diff --git a/src/app/()/page.tsx b/src/app/()/page.tsx index d50498f..9d58b8d 100644 --- a/src/app/()/page.tsx +++ b/src/app/()/page.tsx @@ -105,14 +105,14 @@ export default function IndexPage() {
{`// 1. 重定向到授权页面(必须通过浏览器重定向,不能使用 AJAX/Fetch)
-window.location.href = 'https://connect.q58.pro/oauth/authorize?' + new URLSearchParams({
+window.location.href = 'https://connect.q58.club/oauth/authorize?' + new URLSearchParams({
response_type: 'code',
client_id: 'your_client_id',
redirect_uri: 'https://your-app.com/callback'
});
// 2. 在回调页面获取访问令牌
-const response = await fetch('https://connect.q58.pro/api/oauth/access_token', {
+const response = await fetch('https://connect.q58.club/api/oauth/access_token', {
method: 'POST',
body: new URLSearchParams({
code: '授权码',
@@ -122,7 +122,7 @@ const response = await fetch('https://connect.q58.pro/api/oauth/access_token', {
const { access_token } = await response.json();
// 3. 获取用户信息
-const userInfo = await fetch('https://connect.q58.pro/api/oauth/user', {
+const userInfo = await fetch('https://connect.q58.club/api/oauth/user', {
headers: {
'Authorization': \`Bearer \${access_token}\`
}
@@ -138,7 +138,7 @@ const userInfo = await fetch('https://connect.q58.pro/api/oauth/user', {