first commit
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled
Sync to CNB / sync (push) Has been cancelled
Delete old workflow runs / del_runs (push) Has been cancelled
Upstream Sync / Sync latest commits from upstream repo (push) Has been cancelled

This commit is contained in:
2026-01-30 16:57:44 +08:00
commit 3d175d75af
119 changed files with 35834 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
interface ApiResponse<T> {
data: T
}
interface QrCodeData {
qrCodeUrl: string
sid: string
}
export async function POST() {
try {
const response = await fetch('https://api.extscreen.com/aliyundrive/qrcode', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
scopes: ["user:base", "file:all:read", "file:all:write"].join(','),
width: 500,
height: 500,
})
})
if (!response.ok) {
throw new Error('Failed to generate QR code')
}
const result: ApiResponse<QrCodeData> = await response.json()
return Response.json({
qr_link: result.data.qrCodeUrl,
sid: result.data.sid
})
} catch (error: any) {
return Response.json(
{ error: error.message },
{ status: 500 }
)
}
}