From 2b90f34fd63aed9b873cb988856e0be563d69ba6 Mon Sep 17 00:00:00 2001 From: JJAYCHEN <31304335+JJAYCHEN1e@users.noreply.github.com> Date: Thu, 6 Jan 2022 16:35:06 +0800 Subject: [PATCH] fix: Fix 'no-cors' error for marketplace downloaded plugin. --- package.json | 2 +- src/main.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5685ab4..b61d616 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "logseq-plugin-image-uploader", - "version": "0.0.1", + "version": "0.0.2", "main": "dist/index.html", "scripts": { "dev": "vite", diff --git a/src/main.tsx b/src/main.tsx index 2afcf19..811475f 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -4,6 +4,7 @@ import { BlockEntity, PageEntity } from '@logseq/libs/dist/LSPlugin'; async function uploadImage(url: string): Promise { return url = await fetch("http://localhost:36677/upload", { method: "POST", + mode: "no-cors", body: JSON.stringify({ list: [url]}) }) .then(res => res.json())