From 590040fa1d7e1fda6011207574750fe44fae0a55 Mon Sep 17 00:00:00 2001 From: "BOOK-BKT8UBVE0A\\dhfkd" Date: Wed, 19 Mar 2025 16:23:19 +0900 Subject: [PATCH 1/6] =?UTF-8?q?=EC=9E=90=EB=8F=99=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=9D=B8=20id=20=EC=9E=85=EB=A0=A5=20=EC=88=98=EC=A0=95=20#913?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/auth/AutoLogin.jsx | 109 ++++++++++++++++++++++++++---- src/components/auth/Login.jsx | 6 +- src/locales/ja.json | 1 + src/locales/ko.json | 1 + 4 files changed, 103 insertions(+), 14 deletions(-) diff --git a/src/components/auth/AutoLogin.jsx b/src/components/auth/AutoLogin.jsx index d400f2c4..b3dcbb6e 100644 --- a/src/components/auth/AutoLogin.jsx +++ b/src/components/auth/AutoLogin.jsx @@ -2,26 +2,111 @@ import { useState } from 'react' import { useMessage } from '@/hooks/useMessage' +import { setSession, login } from '@/lib/authActions' +import { sessionStore } from '@/store/commonAtom' +import { useRecoilState } from 'recoil' +import { useAxios } from '@/hooks/useAxios' +import { globalLocaleStore } from '@/store/localeAtom' +import { useRouter } from 'next/navigation' + import GlobalSpinner from '@/components/common/spinner/GlobalSpinner' -export default function AutoLoginPage() { - const [isLoading, setIsLoading] = useState(true) +export default function AutoLoginPage({ autoLoginParam }) { + const router = useRouter() + + const [isLoading, setIsLoading] = useState(autoLoginParam === 'Y' ? false : true) + const [globalLocaleState, setGlbalLocaleState] = useRecoilState(globalLocaleStore) + + const { promisePost } = useAxios(globalLocaleState) const { getMessage } = useMessage() + const [userId, setUserId] = useState('') + const [sessionState, setSessionState] = useRecoilState(sessionStore) + + const [idFocus, setIdFocus] = useState(false) + + const loginProcess = async () => { + setIsLoading(true) + await promisePost({ url: '/api/login/v1.0/user', data: { loginId: userId } }).then((response) => { + setIsLoading(false) + if (response.data) { + const res = response.data + const result = { ...res, storeLvl: res.groupId === '60000' ? '1' : '2', pwdInitYn: 'Y' } + setSession(result) + setSessionState(result) + login() + } else { + alert(getMessage('login.fail')) + router.push('/login?autoLoginParam1=Y') + } + }) + } + return ( <> {isLoading && } -
-
- {getMessage('site.name')} - {getMessage('site.sub_name')} -
-
-
- {getMessage('login.auto.page.text')} + {autoLoginParam !== 'Y' ? ( + <> +
+
+ {getMessage('site.name')} + {getMessage('site.sub_name')} +
+
+
+ {getMessage('login.auto.page.text')} +
+
-
-
+ + ) : ( + <> +
+
{ + e.preventDefault() + loginProcess() + }} + className="space-y-6" + > +
+ {getMessage('site.name')} + {getMessage('site.sub_name')} +
+
+
+ { + setUserId(e.target.value) + }} + onFocus={() => setIdFocus(true)} + onBlur={() => setIdFocus(false)} + /> + +
+
+ +
+
+
+
+ + )} ) } diff --git a/src/components/auth/Login.jsx b/src/components/auth/Login.jsx index 85e342d4..7a6ba957 100644 --- a/src/components/auth/Login.jsx +++ b/src/components/auth/Login.jsx @@ -25,7 +25,9 @@ export default function Login() { useEffect(() => { if (autoLoginParam) { - autoLoginProcess(autoLoginParam) + if (autoLoginParam !== 'Y') { + autoLoginProcess(autoLoginParam) + } } // console.log('🚀 ~ checkSession ~ checkSession():', checkSession()) @@ -334,7 +336,7 @@ export default function Login() {
)} - {autoLoginParam && } + {autoLoginParam && }
COPYRIGHT©2024 Hanwha Japan All Rights Reserved.
diff --git a/src/locales/ja.json b/src/locales/ja.json index 80850e4b..e91861ac 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -594,6 +594,7 @@ "myinfo.message.password.error": "パスワードが間違っています。", "login": "ログイン", "login.auto.page.text": "自動ログイン中です。", + "login.fail": "アカウントが存在しないか、パスワードが間違っています。", "login.id.save": "ID保存", "login.id.placeholder": "IDを入力してください。", "login.password.placeholder": "パスワードを入力してください。", diff --git a/src/locales/ko.json b/src/locales/ko.json index e5c98ce5..be5154ac 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -594,6 +594,7 @@ "myinfo.message.password.error": "비밀번호가 틀렸습니다.", "login": "로그인", "login.auto.page.text": "자동로그인 중 입니다.", + "login.fail": "계정이 없거나 비밀번호가 잘못되었습니다.", "login.id.save": "ID Save", "login.id.placeholder": "아이디를 입력해주세요.", "login.password.placeholder": "비밀번호를 입력해주세요.", From f7fe0f6528062d46329b5a3c9c5ac52da3b80d1d Mon Sep 17 00:00:00 2001 From: basssy Date: Wed, 19 Mar 2025 17:40:13 +0900 Subject: [PATCH 2/6] =?UTF-8?q?#925=20=EA=B2=AC=EC=A0=81=EC=84=9C=20?= =?UTF-8?q?=EC=83=81=EC=84=B8=20=EA=B0=80=EA=B2=A9=ED=91=9C=EC=8B=9C=20?= =?UTF-8?q?=EC=98=B5=EC=85=98=20&=20=ED=94=84=EB=9D=BC=EC=9D=B4=EC=8B=B1?= =?UTF-8?q?=20=ED=98=B8=EC=B6=9C=20=ED=8C=8C=EB=9D=BC=EB=AF=B8=ED=84=B0=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/estimate/Estimate.jsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index a44af878..06df265d 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -377,8 +377,8 @@ export default function Estimate({}) { useEffect(() => { if (estimateContextState.estimateType !== '') { const param = { - saleStoreId: session.storeId, - sapSalesStoreCd: session.custCd, + saleStoreId: estimateContextState.sapSaleStoreId, + sapSalesStoreCd: estimateContextState.sapSalesStoreCd, docTpCd: estimateContextState?.estimateType, } @@ -481,8 +481,8 @@ export default function Estimate({}) { //Pricing 버튼 const handlePricing = async (showPriceCd) => { const param = { - saleStoreId: session.storeId, - sapSalesStoreCd: session.custCd, + saleStoreId: estimateContextState.sapSaleStoreId, + sapSalesStoreCd: estimateContextState.sapSalesStoreCd, docTpCd: estimateContextState.estimateType, priceCd: showPriceCd, itemIdList: estimateContextState.itemList.filter((item) => item.delFlg === '0' && item.paDispOrder === null), @@ -506,7 +506,6 @@ export default function Estimate({}) { }) } } - setIsGlobalLoading(true) await promisePost({ url: '/api/estimate/price/item-price-list', data: param }).then((res) => { let updateList = [] From 05dd069e537351ac5169ad274ea7648d34fa1390 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Thu, 20 Mar 2025 10:02:09 +0900 Subject: [PATCH 3/6] =?UTF-8?q?modified=20=EC=8B=9C=20lines=20=EC=9C=84?= =?UTF-8?q?=EC=B9=98=20=EC=83=88=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/fabric/QPolygon.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/fabric/QPolygon.js b/src/components/fabric/QPolygon.js index f19687aa..4b15d687 100644 --- a/src/components/fabric/QPolygon.js +++ b/src/components/fabric/QPolygon.js @@ -119,10 +119,12 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, { this.addLengthText() this.on('moving', () => { + this.initLines() this.addLengthText() }) this.on('modified', (e) => { + this.initLines() this.addLengthText() }) @@ -183,7 +185,7 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, { this.lines = [] - this.points.forEach((point, i) => { + this.getCurrentPoints().forEach((point, i) => { const nextPoint = this.points[(i + 1) % this.points.length] const line = new QLine([point.x, point.y, nextPoint.x, nextPoint.y], { stroke: this.stroke, From e7410e53731f79d4c967586a66197b90fc54950b Mon Sep 17 00:00:00 2001 From: basssy Date: Thu, 20 Mar 2025 13:35:06 +0900 Subject: [PATCH 4/6] =?UTF-8?q?=EA=B2=AC=EC=A0=81=EC=84=9C=20=EC=9D=BC?= =?UTF-8?q?=EB=B3=B8=EC=96=B4=20=EB=B3=80=EA=B2=BD=20=EB=88=84=EB=9D=BD?= =?UTF-8?q?=EB=B6=84=20=EC=9E=AC=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/estimate/Estimate.jsx | 4 ++-- src/components/floor-plan/CanvasMenu.jsx | 2 +- src/locales/ja.json | 4 ++-- src/locales/ko.json | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index 06df265d..532d6364 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -387,6 +387,8 @@ export default function Estimate({}) { if (isNotEmptyArray(res?.data)) { setStorePriceList(res.data) } + + setItemChangeYn(true) }) if (estimateContextState.estimateType === 'YJSS') { @@ -416,8 +418,6 @@ export default function Estimate({}) { handlePricing('UNIT_PRICE') } } - - setItemChangeYn(true) } }, [estimateContextState?.estimateType]) diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index 0d9ddc0a..a268604e 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -634,7 +634,7 @@ export default function CanvasMenu(props) { onClick={() => setEstimatePopupOpen(true)} > - {getMessage('plan.menu.estimate.docDown')} + {getMessage('plan.menu.estimate.docDownload')}