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