修复关注

This commit is contained in:
浪子
2026-05-14 14:19:23 +08:00
parent 5a9acd60c5
commit 635aad8162
7 changed files with 157 additions and 21 deletions
+4
View File
@@ -16,6 +16,8 @@ import { ensureAdminUser } from "./db";
import { HttpError, cors, json, svgResponse } from "./http";
import {
accountStatuses,
accountFollowers,
accountFollowing,
authorize,
authorizeFollowRequest,
authorizePage,
@@ -115,6 +117,8 @@ async function route(request: Request, env: Env): Promise<Response> {
if (method === "GET" && (m = path.match(/^\/api\/v1\/accounts\/([^/]+)$/))) return getAccount(env, decodeURIComponent(m[1]));
if (method === "GET" && (m = path.match(/^\/api\/v1\/accounts\/([^/]+)\/statuses$/))) return accountStatuses(request, env, decodeURIComponent(m[1]));
if (method === "GET" && (m = path.match(/^\/api\/v1\/accounts\/([^/]+)\/followers$/))) return accountFollowers(request, env, decodeURIComponent(m[1]));
if (method === "GET" && (m = path.match(/^\/api\/v1\/accounts\/([^/]+)\/following$/))) return accountFollowing(request, env, decodeURIComponent(m[1]));
if (method === "POST" && (m = path.match(/^\/api\/v1\/accounts\/([^/]+)\/follow$/))) return followAccount(request, env, decodeURIComponent(m[1]));
if (method === "POST" && (m = path.match(/^\/api\/v1\/accounts\/([^/]+)\/unfollow$/))) return unfollowAccount(request, env, decodeURIComponent(m[1]));