diff --git a/src/app/api/auth/login/route.ts b/src/app/api/auth/login/route.ts index cb7ab8f..a26ecc4 100644 --- a/src/app/api/auth/login/route.ts +++ b/src/app/api/auth/login/route.ts @@ -16,7 +16,6 @@ export async function POST(request: Request) { const body = await request.json() const { phone, password } = loginSchema.parse(body) - console.log('登录尝试:', phone) // 添加日志 // 查找用户 - 使用正确的查询方式 const user = await prisma.user.findUnique({ @@ -25,10 +24,8 @@ export async function POST(request: Request) { }, }) - console.log('找到用户:', user) // 添加日志 if (!user) { - console.log('用户不存在:', phone) return NextResponse.json( { success: false, error: '用户不存在' }, { status: 401 } @@ -37,7 +34,6 @@ export async function POST(request: Request) { // 验证密码 const passwordMatch = await compare(password, user.password || '') - console.log('密码验证结果:', passwordMatch) if (!passwordMatch) { return NextResponse.json({ diff --git a/src/app/dashboard/components/allocationStatus.tsx b/src/app/dashboard/components/allocationStatus.tsx index 00b3b09..8df8df8 100644 --- a/src/app/dashboard/components/allocationStatus.tsx +++ b/src/app/dashboard/components/allocationStatus.tsx @@ -73,13 +73,11 @@ export default function AllocationStatus({ detailed = false }: { detailed?: bool setLoading(true) const timeCondition = getTimeCondition() - console.log('查询时间条件:', timeCondition) const response = await fetch(`/api/stats?type=allocation_status&time=${encodeURIComponent(timeCondition)}`) if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`) const result = await response.json() - console.log(result, 'AllocationStatus的查询结果') // 数据验证 const validatedData = (result as ApiAllocationStatus[]).map((item) => ({ diff --git a/src/app/dashboard/components/edge.tsx b/src/app/dashboard/components/edge.tsx index bfc6fb0..c5dbc3b 100644 --- a/src/app/dashboard/components/edge.tsx +++ b/src/app/dashboard/components/edge.tsx @@ -48,7 +48,6 @@ export default function Edge() { if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`) const result = await response.json() - console.log('Edge节点返回结果:', result) type ResultEdge = { id: number diff --git a/src/app/dashboard/components/gatewayConfig.tsx b/src/app/dashboard/components/gatewayConfig.tsx index 98bad33..b5a8214 100644 --- a/src/app/dashboard/components/gatewayConfig.tsx +++ b/src/app/dashboard/components/gatewayConfig.tsx @@ -53,8 +53,6 @@ export default function GatewayConfig() { throw new Error(result.error || '查询失败') } - console.log('API返回数据:', result) - // 检查返回的数据是否有效 if (!result || result.length === 0) { setError(`未找到MAC地址为 ${mac} 的网关配置信息`) diff --git a/src/app/dashboard/components/gatewayinfo.tsx b/src/app/dashboard/components/gatewayinfo.tsx index 8a70c8f..e088be8 100644 --- a/src/app/dashboard/components/gatewayinfo.tsx +++ b/src/app/dashboard/components/gatewayinfo.tsx @@ -31,7 +31,6 @@ export default function Gatewayinfo() { } const result = await response.json() - console.log('网关信息API返回数据:', result) setData(result) } catch (error) { diff --git a/src/middleware.ts b/src/middleware.ts index a2c5672..e7aa41d 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -22,16 +22,13 @@ export async function middleware(request: NextRequest) { return NextResponse.next() } // 其他路径都视为受保护路径,重定向到登录页 - console.log(request.nextUrl.pathname, 22222222222222222); return NextResponse.redirect(new URL('/login', request.url)) } // 给没有页面的路径添加跳转页面 if (request.nextUrl.pathname === '/') { - console.log(request.nextUrl.pathname, 333333333333333333); return NextResponse.redirect(new URL('/dashboard', request.url)) } - console.log(request.nextUrl.pathname, 44444444444444444444); return NextResponse.next() }