force-dynamic

This commit is contained in:
我若为王 2024-12-05 15:02:53 +08:00
parent c42da8e240
commit 2caf2bf819
3 changed files with 4 additions and 7 deletions

View File

@ -2,7 +2,7 @@
import { decrypt, getParams } from '../../utils/decode'; import { decrypt, getParams } from '../../utils/decode';
export const runtime = 'edge' export const runtime = 'edge'
export const dynamic = "force-dynamic"
export async function GET(request, { params }) { export async function GET(request, { params }) {
try { try {
const { sid } = params; const { sid } = params;
@ -21,7 +21,6 @@ export async function GET(request, { params }) {
const tokenResponse = await fetch('http://api.extscreen.com/aliyundrive/v3/token', { const tokenResponse = await fetch('http://api.extscreen.com/aliyundrive/v3/token', {
method: 'POST', method: 'POST',
headers: headers, headers: headers,
next: { revalidate: 0 }, // Disable cache
body: JSON.stringify(sendData) body: JSON.stringify(sendData)
}); });

View File

@ -1,12 +1,11 @@
export const runtime = 'edge' export const runtime = 'edge'
export const dynamic = "force-dynamic"
export async function POST() { export async function POST() {
try { try {
const response = await fetch('http://api.extscreen.com/aliyundrive/qrcode', { const response = await fetch('http://api.extscreen.com/aliyundrive/qrcode', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
next: { revalidate: 0 }, // Disable cache
body: JSON.stringify({ body: JSON.stringify({
scopes: ["user:base", "file:all:read", "file:all:write"].join(','), scopes: ["user:base", "file:all:read", "file:all:write"].join(','),
width: 500, width: 500,

View File

@ -2,7 +2,7 @@
import { decrypt, getParams } from '../utils/decode'; import { decrypt, getParams } from '../utils/decode';
export const runtime = 'edge' export const runtime = 'edge'
export const dynamic = "force-dynamic"
export async function POST(request) { export async function POST(request) {
try { try {
const { refresh_token } = await request.json(); const { refresh_token } = await request.json();
@ -19,7 +19,6 @@ export async function POST(request) {
const response = await fetch('http://api.extscreen.com/aliyundrive/v3/token', { const response = await fetch('http://api.extscreen.com/aliyundrive/v3/token', {
method: 'POST', method: 'POST',
next: { revalidate: 0 }, // Disable cache
headers: headers, headers: headers,
body: JSON.stringify(sendData) body: JSON.stringify(sendData)
}); });