From dab0ff47a1b2525260fdd38782df217961cc23e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=BA=AE=E4=BA=AE?= Date: Mon, 15 Jan 2024 16:38:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions/rest/routes/index.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/functions/rest/routes/index.ts b/functions/rest/routes/index.ts index b5f1c36..0d6b97b 100644 --- a/functions/rest/routes/index.ts +++ b/functions/rest/routes/index.ts @@ -46,8 +46,6 @@ router.post('/checkToken', async (req: Request, env: Env) => { // list image router.post('/list', auth, async (req: Request, env: Env) => { - const BASE_URL = await env.XK.get('BASE_URL') - console.log("BASE_URL=" + BASE_URL) const data = await req.json() as ImgReq if (!data.limit) { data.limit = 10 @@ -76,7 +74,7 @@ router.post('/list', auth, async (req: Request, env: Env) => { const objs = list.objects const urls = objs.map(it => { return { - url: `${BASE_URL}/${it.key}`, + url: `/rest/${it.key}`, key: it.key, size: it.size } @@ -91,7 +89,6 @@ router.post('/list', auth, async (req: Request, env: Env) => { // batch upload file router.post('/upload', auth, async (req: Request, env: Env) => { - const BASE_URL = await env.XK.get('BASE_URL') const files = await req.formData() const images = files.getAll("files") const errs = [] @@ -114,7 +111,7 @@ router.post('/upload', auth, async (req: Request, env: Env) => { urls.push({ key: object.key, size: object.size, - url: `${BASE_URL}/${object.key}`, + url: `/rest/${object.key}`, filename: item.name }) }