From 2340d5d5b58ce2cd1bead2b9c1f244d5efa5377a Mon Sep 17 00:00:00 2001 From: anjaemin Date: Wed, 16 Nov 2022 01:58:48 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20api=20=EB=B3=80=EA=B2=BD=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20filename=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/state/reducers/DownloadFileProps.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/state/reducers/DownloadFileProps.ts b/src/state/reducers/DownloadFileProps.ts index 1c67db0..e707246 100644 --- a/src/state/reducers/DownloadFileProps.ts +++ b/src/state/reducers/DownloadFileProps.ts @@ -3,7 +3,6 @@ import { Action } from '../actions'; const reducer = ( state: any = { - filename: null, fileId: null, token: null, isEncrypted: null, From 06fe52ae27875e530b9da1cf6ca19e18a1d22e49 Mon Sep 17 00:00:00 2001 From: anjaemin Date: Wed, 16 Nov 2022 01:59:39 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20setdownload=20filename=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20=EB=B0=8F=20api=20filename=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/checkpw/index.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/checkpw/index.tsx b/src/pages/checkpw/index.tsx index 5046b3a..5a012c3 100644 --- a/src/pages/checkpw/index.tsx +++ b/src/pages/checkpw/index.tsx @@ -30,11 +30,10 @@ export const CheckPasswordPage: React.FC = () => { } else { await axios({ method: 'get', - url: `${process.env.REACT_APP_BACKEND_BASEURL}/checkpw/${checkPasswordFileProps.fileId}/${checkPasswordFileProps.filename}?pw=${password}`, + url: `${process.env.REACT_APP_BACKEND_BASEURL}/checkpw/${checkPasswordFileProps.fileId}?pw=${password}`, }) .then((res) => { SetDownloadFileProps({ - filename: checkPasswordFileProps.filename, fileId: checkPasswordFileProps.fileId, isEncrypted: checkPasswordFileProps.isEncrypted, token: res.data.token, From eedc3e503e7ee446ddbc1b8614c852d8a2753b97 Mon Sep 17 00:00:00 2001 From: anjaemin Date: Wed, 16 Nov 2022 02:00:14 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20api=20url=20filename=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/download/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/download/index.tsx b/src/pages/download/index.tsx index 39a4d3b..e2c61ab 100644 --- a/src/pages/download/index.tsx +++ b/src/pages/download/index.tsx @@ -33,9 +33,9 @@ export const DownloadPage: React.FC = () => { const getFileProps = async () => { await axios({ method: 'get', - url: `${process.env.REACT_APP_BACKEND_BASEURL}/file/${downloadFileProps.fileId}/${ - downloadFileProps.filename - }${downloadFileProps.isEncrypted ? `?token=${downloadFileProps.token}` : ''}`, + url: `${process.env.REACT_APP_BACKEND_BASEURL}/file/${downloadFileProps.fileId}${ + downloadFileProps.isEncrypted ? `?token=${downloadFileProps.token}` : '' + }`, }) .then((res) => { setFileProps({ @@ -57,7 +57,7 @@ export const DownloadPage: React.FC = () => { console.log(err); }); }; - if (downloadFileProps.filename != null || downloadFileProps.fileId != null) { + if (downloadFileProps.fileId != null) { getFileProps(); } else { navigate('/');