From 565450848506e7e9a76301a137e713182b2056e6 Mon Sep 17 00:00:00 2001 From: dongwoochoi Date: Fri, 19 May 2023 17:48:12 +0900 Subject: [PATCH 01/15] =?UTF-8?q?[Remove]=20=EA=B8=B0=EB=B3=B8=20=20page.t?= =?UTF-8?q?sx=20=EB=B0=B1=EC=A7=80=ED=99=94(=EC=B4=88=EA=B8=B0=ED=99=94)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/page.tsx | 90 ++---------------------------------------------- 1 file changed, 2 insertions(+), 88 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 9ddf9b9..b9048d9 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,95 +1,9 @@ -import Image from 'next/image' -import styles from './page.module.css' + export default function Home() { return ( -
-
-

- Get started by editing  - src/app/page.tsx -

-
- - By{' '} - Vercel Logo - -
-
- -
- Next.js Logo -
- -
- -

- Docs -> -

-

Find in-depth information about Next.js features and API.

-
- - -

- Learn -> -

-

Learn about Next.js in an interactive course with quizzes!

-
- - -

- Templates -> -

-

Explore the Next.js 13 playground.

-
+
- -

- Deploy -> -

-

- Instantly deploy your Next.js site to a shareable URL with Vercel. -

-
-
) } From b6bcbd67e8aac65bd347985b6c858a6d5a7f8f6d Mon Sep 17 00:00:00 2001 From: dongwoochoi Date: Sat, 20 May 2023 14:11:56 +0900 Subject: [PATCH 02/15] =?UTF-8?q?[Create}=20delete=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/page.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index b9048d9..436903e 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,9 +1,7 @@ - - export default function Home() { return (
- +
) } From 856835ca3f31264e38c066afdaf55f9371793391 Mon Sep 17 00:00:00 2001 From: dongwoochoi Date: Sat, 20 May 2023 15:30:30 +0900 Subject: [PATCH 03/15] =?UTF-8?q?[Feat]=20=ED=83=88=ED=87=B4=EB=A5=BC=20?= =?UTF-8?q?=EC=9C=84=ED=95=9C=20fetchDelete=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20=ED=9B=84=20=EB=B2=84=ED=8A=BC=EC=97=90=20?= =?UTF-8?q?=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 152 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + src/app/page.tsx | 22 ++++++- 3 files changed, 174 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 617f45e..163c89c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "@types/node": "20.2.1", "@types/react": "18.2.6", "@types/react-dom": "18.2.4", + "axios": "^1.4.0", "eslint": "8.40.0", "eslint-config-next": "13.4.3", "next": "13.4.3", @@ -616,6 +617,11 @@ "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", "integrity": "sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==" }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, "node_modules/available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", @@ -635,6 +641,16 @@ "node": ">=4" } }, + "node_modules/axios": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz", + "integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/axobject-query": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz", @@ -787,6 +803,17 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -922,6 +949,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -1623,6 +1658,25 @@ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==" }, + "node_modules/follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -1631,6 +1685,19 @@ "is-callable": "^1.1.3" } }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2447,6 +2514,25 @@ "node": ">=8.6" } }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/mimic-fn": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", @@ -2883,6 +2969,11 @@ "react-is": "^16.13.1" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/punycode": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", @@ -4016,6 +4107,11 @@ "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", "integrity": "sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==" }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, "available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", @@ -4026,6 +4122,16 @@ "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.7.1.tgz", "integrity": "sha512-sCXXUhA+cljomZ3ZAwb8i1p3oOlkABzPy08ZDAoGcYuvtBPlQ1Ytde129ArXyHWDhfeewq7rlx9F+cUx2SSlkg==" }, + "axios": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz", + "integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", + "requires": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "axobject-query": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz", @@ -4131,6 +4237,14 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -4228,6 +4342,11 @@ "object-keys": "^1.1.1" } }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" + }, "dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -4761,6 +4880,11 @@ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==" }, + "follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" + }, "for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -4769,6 +4893,16 @@ "is-callable": "^1.1.3" } }, + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -5313,6 +5447,19 @@ "picomatch": "^2.3.1" } }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "requires": { + "mime-db": "1.52.0" + } + }, "mimic-fn": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", @@ -5582,6 +5729,11 @@ "react-is": "^16.13.1" } }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "punycode": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", diff --git a/package.json b/package.json index 064aa6f..e1d4fc6 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "@types/node": "20.2.1", "@types/react": "18.2.6", "@types/react-dom": "18.2.4", + "axios": "^1.4.0", "eslint": "8.40.0", "eslint-config-next": "13.4.3", "next": "13.4.3", diff --git a/src/app/page.tsx b/src/app/page.tsx index 436903e..9d9ccfa 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,7 +1,27 @@ +import axios from 'axios'; + export default function Home() { + + const fetchDelete = async () => { + try { + const response = await axios.get(''); + console.log(response.data); + if (response.status === 200) { + alert('정상적으로 탈퇴 되었습니다.'); + } + if (response.status === 401) { + alert('인증되지 않아 해당 작업을 수행할 수 없습니다.'); + } + } catch (error) { + console.error(error); + } + }; + return (
- +
) } From dace0e2720c33464c1a5cc7d7957ea82ffc7b0c4 Mon Sep 17 00:00:00 2001 From: dongwoochoi Date: Sat, 20 May 2023 16:30:35 +0900 Subject: [PATCH 04/15] =?UTF-8?q?[Fix]=20use=20client=20=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/page.tsx | 9 ++++++--- src/delete/delete.tsx | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 src/delete/delete.tsx diff --git a/src/app/page.tsx b/src/app/page.tsx index 9d9ccfa..1a60be7 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,10 +1,12 @@ -import axios from 'axios'; +"use client"; +import axios, { AxiosResponse } from 'axios'; + export default function Home() { const fetchDelete = async () => { try { - const response = await axios.get(''); + const response = await axios.get('삭제 url'); console.log(response.data); if (response.status === 200) { alert('정상적으로 탈퇴 되었습니다.'); @@ -13,6 +15,7 @@ export default function Home() { alert('인증되지 않아 해당 작업을 수행할 수 없습니다.'); } } catch (error) { + console.log('실패함') console.error(error); } }; @@ -24,4 +27,4 @@ export default function Home() { }}>Delete ) -} +} \ No newline at end of file diff --git a/src/delete/delete.tsx b/src/delete/delete.tsx new file mode 100644 index 0000000..06b590a --- /dev/null +++ b/src/delete/delete.tsx @@ -0,0 +1,27 @@ +import axios from 'axios'; + +export default function Home() { + + const fetchDelete = async () => { + try { + const response = await axios.get('삭제 url'); + console.log(response.data); + if (response.status === 200) { + alert('정상적으로 탈퇴 되었습니다.'); + } + if (response.status === 401) { + alert('인증되지 않아 해당 작업을 수행할 수 없습니다.'); + } + } catch (error) { + console.error(error); + } + }; + + return ( +
+ +
+ ) +} From a54c5e1c5252499de05dfb3e43f2e6bcd988c2fa Mon Sep 17 00:00:00 2001 From: dongwoochoi Date: Sat, 20 May 2023 16:38:42 +0900 Subject: [PATCH 05/15] =?UTF-8?q?[Fix]=20=EC=9D=B8=ED=84=B0=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=8A=A4=20=EC=A0=95=EC=9D=98=20=EB=B0=8F=20=ED=83=80?= =?UTF-8?q?=EC=9E=85=20=EB=AA=85=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/page.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 1a60be7..cec39b3 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,13 +1,16 @@ "use client"; import axios, { AxiosResponse } from 'axios'; +interface Response{ + 'status' : number +} export default function Home() { const fetchDelete = async () => { try { - const response = await axios.get('삭제 url'); - console.log(response.data); + const response: AxiosResponse = await axios.get('delete url'); + console.log(response); if (response.status === 200) { alert('정상적으로 탈퇴 되었습니다.'); } @@ -15,7 +18,7 @@ export default function Home() { alert('인증되지 않아 해당 작업을 수행할 수 없습니다.'); } } catch (error) { - console.log('실패함') + console.log('실패'); console.error(error); } }; From 28c48a7d8c5a60fe1ea0242dd384064e65c0f0f0 Mon Sep 17 00:00:00 2001 From: dongwoochoi Date: Sat, 20 May 2023 17:27:57 +0900 Subject: [PATCH 06/15] =?UTF-8?q?[Feat]=202=EC=A4=91=EC=9D=B8=EC=A6=9D=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20popup?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/page.tsx | 22 ++------- src/delete/popup.tsx | 109 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+), 19 deletions(-) create mode 100644 src/delete/popup.tsx diff --git a/src/app/page.tsx b/src/app/page.tsx index cec39b3..7808bc3 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,5 +1,7 @@ "use client"; import axios, { AxiosResponse } from 'axios'; +import Popup from '@/delete/popup'; +import { useState } from 'react'; interface Response{ 'status' : number @@ -7,27 +9,9 @@ interface Response{ export default function Home() { - const fetchDelete = async () => { - try { - const response: AxiosResponse = await axios.get('delete url'); - console.log(response); - if (response.status === 200) { - alert('정상적으로 탈퇴 되었습니다.'); - } - if (response.status === 401) { - alert('인증되지 않아 해당 작업을 수행할 수 없습니다.'); - } - } catch (error) { - console.log('실패'); - console.error(error); - } - }; - return (
- +
) } \ No newline at end of file diff --git a/src/delete/popup.tsx b/src/delete/popup.tsx new file mode 100644 index 0000000..af60742 --- /dev/null +++ b/src/delete/popup.tsx @@ -0,0 +1,109 @@ +"use client"; +import axios, { AxiosResponse } from 'axios'; +import { useState } from 'react'; + +interface Response{ + 'status' : number + } + +export default function Popup() { + const [isOpen, setIsOpen] = useState(false); + const [pw, set_pw] = useState(""); + const [isS, set_isS] = useState(false); + + const openPopup = () => { + setIsOpen(true); + }; + + const closePopup = () => { + setIsOpen(false); + }; + + const fetchDelete = async () => { + try { + const response: AxiosResponse = await axios.get('delete url'); + console.log(response); + if (response.status === 200) { + alert('정상적으로 탈퇴 되었습니다.'); + } + if (response.status === 401) { + alert('인증되지 않아 해당 작업을 수행할 수 없습니다.'); + } + } catch (error) { + alert('탈퇴 요청 실패') + console.log('실패'); + console.error(error); + } + }; + + const fetchAuthentication = async () =>{ + console.log(pw) + try{ + const response: AxiosResponse = await axios.post('login url',{ + 'id' : '쿠키에 저장되어있던 id', + 'pw' : pw + }); + console.log(response); + if (response.status === 200) { + alert('인증에 성공했습니다'); + closePopup() + set_isS(true); + } + if (response.status === 401) { + alert('비밀번호를 확인해 주세요'); + closePopup() + } + } catch (error) { + alert('2중 인증 요청 실패') + console.log('실패'); + console.error(error); + closePopup() + } + } + + return ( +
+ { + isS ? : + } + + + {isOpen && ( +
+
+

본인 인증

+

확인을 위해 비밀번호를 입력해 주세요

+ { set_pw(e.target.value) }}/> +
+ +
+
+ )} + + +

현재 인증 상태

+ { + isS ?

인증 안됨

:

인증 됨

+ } + +
+ ); +} \ No newline at end of file From c1b13d86d60a3e91ac05886e05ac716b76393819 Mon Sep 17 00:00:00 2001 From: dongwoochoi Date: Sat, 20 May 2023 17:36:29 +0900 Subject: [PATCH 07/15] =?UTF-8?q?[Fix]=20state=EB=B6=80=EB=B6=84=20?= =?UTF-8?q?=ED=83=80=EC=9E=85=20=EB=AA=85=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/delete/popup.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/delete/popup.tsx b/src/delete/popup.tsx index af60742..c97feb5 100644 --- a/src/delete/popup.tsx +++ b/src/delete/popup.tsx @@ -7,9 +7,9 @@ interface Response{ } export default function Popup() { - const [isOpen, setIsOpen] = useState(false); - const [pw, set_pw] = useState(""); - const [isS, set_isS] = useState(false); + const [isOpen, setIsOpen] = useState(false); + const [pw, set_pw] = useState(""); + const [isS, set_isS] = useState(false); const openPopup = () => { setIsOpen(true); From b6e692a441e714f2bf2ea36aa5f02d88ab247944 Mon Sep 17 00:00:00 2001 From: dongwoochoi Date: Mon, 22 May 2023 20:34:54 +0900 Subject: [PATCH 08/15] =?UTF-8?q?[Rename]=20=ED=94=84=EB=A1=9C=EC=A0=9D?= =?UTF-8?q?=ED=8A=B8=20=ED=8F=B4=EB=8D=94=EA=B5=AC=EC=A1=B0=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/page.tsx | 12 ++---------- src/delete/delete.tsx | 27 --------------------------- src/pages/delete.tsx | 11 +++++++++++ src/types/delete.ts | 3 +++ src/{delete => utils}/popup.tsx | 12 +++++------- 5 files changed, 21 insertions(+), 44 deletions(-) delete mode 100644 src/delete/delete.tsx create mode 100644 src/pages/delete.tsx create mode 100644 src/types/delete.ts rename src/{delete => utils}/popup.tsx (91%) diff --git a/src/app/page.tsx b/src/app/page.tsx index 7808bc3..04d5fcd 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,17 +1,9 @@ -"use client"; -import axios, { AxiosResponse } from 'axios'; -import Popup from '@/delete/popup'; -import { useState } from 'react'; - -interface Response{ - 'status' : number -} +import axios from 'axios'; export default function Home() { return (
-
) -} \ No newline at end of file +} diff --git a/src/delete/delete.tsx b/src/delete/delete.tsx deleted file mode 100644 index 06b590a..0000000 --- a/src/delete/delete.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import axios from 'axios'; - -export default function Home() { - - const fetchDelete = async () => { - try { - const response = await axios.get('삭제 url'); - console.log(response.data); - if (response.status === 200) { - alert('정상적으로 탈퇴 되었습니다.'); - } - if (response.status === 401) { - alert('인증되지 않아 해당 작업을 수행할 수 없습니다.'); - } - } catch (error) { - console.error(error); - } - }; - - return ( -
- -
- ) -} diff --git a/src/pages/delete.tsx b/src/pages/delete.tsx new file mode 100644 index 0000000..b56c606 --- /dev/null +++ b/src/pages/delete.tsx @@ -0,0 +1,11 @@ +"use client"; +import Popup from '@/utils/popup'; + +export default function Delete() { + + return ( +
+ +
+ ) +} diff --git a/src/types/delete.ts b/src/types/delete.ts new file mode 100644 index 0000000..3d1f226 --- /dev/null +++ b/src/types/delete.ts @@ -0,0 +1,3 @@ +export interface d_response{ + 'status' : number + } \ No newline at end of file diff --git a/src/delete/popup.tsx b/src/utils/popup.tsx similarity index 91% rename from src/delete/popup.tsx rename to src/utils/popup.tsx index c97feb5..277ab56 100644 --- a/src/delete/popup.tsx +++ b/src/utils/popup.tsx @@ -1,10 +1,8 @@ "use client"; +import { d_response } from '@/types/delete'; import axios, { AxiosResponse } from 'axios'; import { useState } from 'react'; -interface Response{ - 'status' : number - } export default function Popup() { const [isOpen, setIsOpen] = useState(false); @@ -21,7 +19,7 @@ export default function Popup() { const fetchDelete = async () => { try { - const response: AxiosResponse = await axios.get('delete url'); + const response: AxiosResponse = await axios.get('https://www.ideaconnect.online/auth'); console.log(response); if (response.status === 200) { alert('정상적으로 탈퇴 되었습니다.'); @@ -39,7 +37,7 @@ export default function Popup() { const fetchAuthentication = async () =>{ console.log(pw) try{ - const response: AxiosResponse = await axios.post('login url',{ + const response: AxiosResponse = await axios.post('https://www.ideaconnect.online/login',{ 'id' : '쿠키에 저장되어있던 id', 'pw' : pw }); @@ -51,10 +49,10 @@ export default function Popup() { } if (response.status === 401) { alert('비밀번호를 확인해 주세요'); - closePopup() + } } catch (error) { - alert('2중 인증 요청 실패') + alert('인증 요청 실패, 다시 시도해 주세요') console.log('실패'); console.error(error); closePopup() From 36269d7cb0501c598e9a1e44e4bfd84484c10d5a Mon Sep 17 00:00:00 2001 From: dongwoochoi Date: Tue, 23 May 2023 19:46:22 +0900 Subject: [PATCH 09/15] =?UTF-8?q?[Refactor]=20=EC=9D=B8=ED=84=B0=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=8A=A4=20=EB=AA=85=20=EB=B3=80=EA=B2=BD=20d=5Fresop?= =?UTF-8?q?nse=20->=20UserDeleteResponseDto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/types/delete.ts | 2 +- src/utils/popup.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/types/delete.ts b/src/types/delete.ts index 3d1f226..929ec04 100644 --- a/src/types/delete.ts +++ b/src/types/delete.ts @@ -1,3 +1,3 @@ -export interface d_response{ +export interface UserDeleteResponseDto{ 'status' : number } \ No newline at end of file diff --git a/src/utils/popup.tsx b/src/utils/popup.tsx index 277ab56..907571f 100644 --- a/src/utils/popup.tsx +++ b/src/utils/popup.tsx @@ -1,5 +1,5 @@ "use client"; -import { d_response } from '@/types/delete'; +import { UserDeleteResponseDto } from '@/types/delete'; import axios, { AxiosResponse } from 'axios'; import { useState } from 'react'; @@ -19,7 +19,7 @@ export default function Popup() { const fetchDelete = async () => { try { - const response: AxiosResponse = await axios.get('https://www.ideaconnect.online/auth'); + const response: AxiosResponse = await axios.get('https://www.ideaconnect.online/auth'); console.log(response); if (response.status === 200) { alert('정상적으로 탈퇴 되었습니다.'); From f52cadbe8e9da47b694ab0c88549f6cc442e094b Mon Sep 17 00:00:00 2001 From: dongwoochoi Date: Tue, 23 May 2023 19:48:22 +0900 Subject: [PATCH 10/15] =?UTF-8?q?[Refactor]=20console.log=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/popup.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/utils/popup.tsx b/src/utils/popup.tsx index 907571f..904fd02 100644 --- a/src/utils/popup.tsx +++ b/src/utils/popup.tsx @@ -20,7 +20,6 @@ export default function Popup() { const fetchDelete = async () => { try { const response: AxiosResponse = await axios.get('https://www.ideaconnect.online/auth'); - console.log(response); if (response.status === 200) { alert('정상적으로 탈퇴 되었습니다.'); } @@ -29,19 +28,16 @@ export default function Popup() { } } catch (error) { alert('탈퇴 요청 실패') - console.log('실패'); - console.error(error); } }; const fetchAuthentication = async () =>{ - console.log(pw) + try{ const response: AxiosResponse = await axios.post('https://www.ideaconnect.online/login',{ 'id' : '쿠키에 저장되어있던 id', 'pw' : pw - }); - console.log(response); + }) if (response.status === 200) { alert('인증에 성공했습니다'); closePopup() @@ -53,8 +49,6 @@ export default function Popup() { } } catch (error) { alert('인증 요청 실패, 다시 시도해 주세요') - console.log('실패'); - console.error(error); closePopup() } } From f57e8214156f0f0a83d5b682506fd2073d678d4c Mon Sep 17 00:00:00 2001 From: dongwoochoi Date: Tue, 23 May 2023 20:23:43 +0900 Subject: [PATCH 11/15] =?UTF-8?q?[Refactor]=20URL=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?=EA=B0=80=EB=8A=A5=EC=84=B1=EC=9D=84=20=EB=AF=B8=EB=A6=AC=20?= =?UTF-8?q?=EB=8C=80=EB=B9=84=EB=A5=BC=20=EC=9C=84=ED=95=9C=20url=20?= =?UTF-8?q?=EB=B3=80=EC=88=98=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/popup.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/popup.tsx b/src/utils/popup.tsx index 904fd02..e5eb83c 100644 --- a/src/utils/popup.tsx +++ b/src/utils/popup.tsx @@ -8,7 +8,7 @@ export default function Popup() { const [isOpen, setIsOpen] = useState(false); const [pw, set_pw] = useState(""); const [isS, set_isS] = useState(false); - + const AUTH_API_BASE_URL = 'https://www.ideaconnect.online'; const openPopup = () => { setIsOpen(true); }; @@ -19,7 +19,7 @@ export default function Popup() { const fetchDelete = async () => { try { - const response: AxiosResponse = await axios.get('https://www.ideaconnect.online/auth'); + const response: AxiosResponse = await axios.get(`${AUTH_API_BASE_URL}/auth`); if (response.status === 200) { alert('정상적으로 탈퇴 되었습니다.'); } @@ -34,7 +34,7 @@ export default function Popup() { const fetchAuthentication = async () =>{ try{ - const response: AxiosResponse = await axios.post('https://www.ideaconnect.online/login',{ + const response: AxiosResponse = await axios.post(`${AUTH_API_BASE_URL}/login`,{ 'id' : '쿠키에 저장되어있던 id', 'pw' : pw }) From 435cc2adc596b54c00f6c8ca8e76e0076d2490a6 Mon Sep 17 00:00:00 2001 From: dongwoochoi Date: Tue, 23 May 2023 20:30:37 +0900 Subject: [PATCH 12/15] =?UTF-8?q?[Remove]=20=EA=B8=B0=EC=A1=B4=20CSS=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/globals.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index d4f491e..515036b 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1,4 +1,4 @@ -:root { +/* :root { --max-width: 1100px; --border-radius: 12px; --font-mono: ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono', @@ -104,4 +104,4 @@ a { html { color-scheme: dark; } -} +} */ From a06d1724be32f4c0e09339be49186a6dd4a2c901 Mon Sep 17 00:00:00 2001 From: dongwoochoi Date: Tue, 30 May 2023 21:27:28 +0900 Subject: [PATCH 13/15] =?UTF-8?q?[Rename]=20=ED=94=84=EB=A1=9C=EC=A0=9D?= =?UTF-8?q?=ED=8A=B8=20=EA=B5=AC=EC=A1=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/globals.css | 4 ++-- src/pages/{ => user}/delete.tsx | 0 src/types/{ => user}/delete.ts | 0 src/utils/popup.tsx | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename src/pages/{ => user}/delete.tsx (100%) rename src/types/{ => user}/delete.ts (100%) diff --git a/src/app/globals.css b/src/app/globals.css index 515036b..d4f491e 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1,4 +1,4 @@ -/* :root { +:root { --max-width: 1100px; --border-radius: 12px; --font-mono: ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono', @@ -104,4 +104,4 @@ a { html { color-scheme: dark; } -} */ +} diff --git a/src/pages/delete.tsx b/src/pages/user/delete.tsx similarity index 100% rename from src/pages/delete.tsx rename to src/pages/user/delete.tsx diff --git a/src/types/delete.ts b/src/types/user/delete.ts similarity index 100% rename from src/types/delete.ts rename to src/types/user/delete.ts diff --git a/src/utils/popup.tsx b/src/utils/popup.tsx index e5eb83c..ddc138c 100644 --- a/src/utils/popup.tsx +++ b/src/utils/popup.tsx @@ -1,5 +1,5 @@ "use client"; -import { UserDeleteResponseDto } from '@/types/delete'; +import { UserDeleteResponseDto } from '@/types/user/delete'; import axios, { AxiosResponse } from 'axios'; import { useState } from 'react'; From 21c79b9ce4303dc59490d7733106271b79d748ce Mon Sep 17 00:00:00 2001 From: dongwoochoi Date: Wed, 31 May 2023 00:16:53 +0900 Subject: [PATCH 14/15] =?UTF-8?q?[Fix]=20response=20=ED=83=80=EC=9E=85=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/user/delete.tsx | 11 ----------- src/types/user/UserDelete.ts | 3 +++ src/types/user/delete.ts | 3 --- src/utils/popup.tsx | 15 ++++++++------- 4 files changed, 11 insertions(+), 21 deletions(-) delete mode 100644 src/pages/user/delete.tsx create mode 100644 src/types/user/UserDelete.ts delete mode 100644 src/types/user/delete.ts diff --git a/src/pages/user/delete.tsx b/src/pages/user/delete.tsx deleted file mode 100644 index b56c606..0000000 --- a/src/pages/user/delete.tsx +++ /dev/null @@ -1,11 +0,0 @@ -"use client"; -import Popup from '@/utils/popup'; - -export default function Delete() { - - return ( -
- -
- ) -} diff --git a/src/types/user/UserDelete.ts b/src/types/user/UserDelete.ts new file mode 100644 index 0000000..fe46789 --- /dev/null +++ b/src/types/user/UserDelete.ts @@ -0,0 +1,3 @@ +export interface UserDeleteResponse { + status: number; +} \ No newline at end of file diff --git a/src/types/user/delete.ts b/src/types/user/delete.ts deleted file mode 100644 index 929ec04..0000000 --- a/src/types/user/delete.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface UserDeleteResponseDto{ - 'status' : number - } \ No newline at end of file diff --git a/src/utils/popup.tsx b/src/utils/popup.tsx index ddc138c..ba08c4d 100644 --- a/src/utils/popup.tsx +++ b/src/utils/popup.tsx @@ -1,5 +1,4 @@ "use client"; -import { UserDeleteResponseDto } from '@/types/user/delete'; import axios, { AxiosResponse } from 'axios'; import { useState } from 'react'; @@ -19,11 +18,12 @@ export default function Popup() { const fetchDelete = async () => { try { - const response: AxiosResponse = await axios.get(`${AUTH_API_BASE_URL}/auth`); - if (response.status === 200) { + const response: AxiosResponse = await axios.get(`${AUTH_API_BASE_URL}/auth`); + const status:number = response.status + if (status === 200) { alert('정상적으로 탈퇴 되었습니다.'); } - if (response.status === 401) { + if (status === 401) { alert('인증되지 않아 해당 작업을 수행할 수 없습니다.'); } } catch (error) { @@ -35,15 +35,16 @@ export default function Popup() { try{ const response: AxiosResponse = await axios.post(`${AUTH_API_BASE_URL}/login`,{ - 'id' : '쿠키에 저장되어있던 id', + 'id' : '쿠키에 저장되어있던 id', //로그인 구현시 인터페이스 정의 예정 'pw' : pw }) - if (response.status === 200) { + const status:number = response.status + if (status === 200) { alert('인증에 성공했습니다'); closePopup() set_isS(true); } - if (response.status === 401) { + if (status === 401) { alert('비밀번호를 확인해 주세요'); } From bfd1a97bebd9def37030974749b37f387c78f8aa Mon Sep 17 00:00:00 2001 From: dongwoochoi Date: Wed, 31 May 2023 00:51:45 +0900 Subject: [PATCH 15/15] =?UTF-8?q?[Remove]=20=ED=83=80=EC=9E=85=EC=A0=95?= =?UTF-8?q?=EC=9D=98=20=EB=B6=88=ED=95=84=EC=9A=94=EC=97=90=20=EB=94=B0?= =?UTF-8?q?=EB=A5=B8=20=EC=9D=B8=ED=84=B0=ED=8E=98=EC=9D=B4=EC=8A=A4=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C=20UserDelete?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/types/user/UserDelete.ts | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 src/types/user/UserDelete.ts diff --git a/src/types/user/UserDelete.ts b/src/types/user/UserDelete.ts deleted file mode 100644 index fe46789..0000000 --- a/src/types/user/UserDelete.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface UserDeleteResponse { - status: number; -} \ No newline at end of file