chore codes

This commit is contained in:
oiov
2025-05-30 11:15:03 +08:00
parent d7c213c110
commit 2f19553dec
2 changed files with 2 additions and 14 deletions
+1 -5
View File
@@ -1,13 +1,9 @@
import { getClientGeolocation, getIpInfo } from "@/lib/geo";
import { getIpInfo } from "@/lib/geo";
export async function GET(req: Request) {
try {
const data = await getIpInfo(req);
const geo = await getClientGeolocation(data.ip);
console.log("[ClientGeolocation]", geo);
return Response.json({
ip: data.ip,
city: data.city,
+1 -9
View File
@@ -4,12 +4,7 @@ import { auth } from "auth";
import { NextAuthRequest } from "next-auth/lib";
import { siteConfig } from "./config/site";
import {
extractRealIP,
getClientGeolocation,
getGeolocation,
getUserAgent,
} from "./lib/geo";
import { extractRealIP, getGeolocation, getUserAgent } from "./lib/geo";
export const config = {
matcher: ["/((?!api|_next/static|_next/image|favicon.ico).*)"],
@@ -39,9 +34,6 @@ async function handleShortUrl(req: NextAuthRequest) {
const geo = await getGeolocation(req, ip || "::1");
const test_geo = await getClientGeolocation(ip);
console.log("[ClientGeolocation]", test_geo);
const url = new URL(req.url);
const password = url.searchParams.get("password") || "";