@daeryun/dr_components 1.2.87 → 1.2.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,23 +16,23 @@ import * as gtag from '../../lib/gtag';
16
16
  */
17
17
  export const useLoginUuidSync = () => {
18
18
  const hasProcessed = useRef(false);
19
- console.log('useLoginUuidSync 훅 호출됨');
19
+ // console.log('useLoginUuidSync 훅 호출됨');
20
20
  useEffect(() => {
21
- console.log('useLoginUuidSync useEffect 실행, hasProcessed:', hasProcessed.current);
21
+ // console.log('useLoginUuidSync useEffect 실행, hasProcessed:', hasProcessed.current);
22
22
  // 이미 처리했으면 스킵
23
23
  if (hasProcessed.current) {
24
- console.log('useLoginUuidSync: 이미 처리됨, 스킵');
24
+ // console.log('useLoginUuidSync: 이미 처리됨, 스킵');
25
25
  return;
26
26
  }
27
27
  const syncUuid = () => __awaiter(void 0, void 0, void 0, function* () {
28
28
  var _a, _b, _c;
29
- console.log('useLoginUuidSync syncUuid 함수 시작');
29
+ // console.log('useLoginUuidSync syncUuid 함수 시작');
30
30
  try {
31
31
  // URL에 이미 uuid가 있으면 스킵
32
32
  const urlParams = new URLSearchParams(window.location.search);
33
- console.log('useLoginUuidSync 현재 URL:', window.location.href);
33
+ // console.log('useLoginUuidSync 현재 URL:', window.location.href);
34
34
  if (urlParams.has('uuid')) {
35
- console.log('useLoginUuidSync: URL에 이미 uuid 있음');
35
+ // console.log('useLoginUuidSync: URL에 이미 uuid 있음');
36
36
  return;
37
37
  }
38
38
  // 로그인 상태 및 idx 조회
@@ -41,18 +41,18 @@ export const useLoginUuidSync = () => {
41
41
  headers: { 'Content-Type': 'application/json' },
42
42
  credentials: 'include'
43
43
  }).then(res => res.json());
44
- console.log('useLoginUuidSync result:', result);
44
+ // console.log('useLoginUuidSync result:', result);
45
45
  // 로그인 안 됨
46
46
  if (!((_a = result.data) === null || _a === void 0 ? void 0 : _a.email) || !((_b = result.data) === null || _b === void 0 ? void 0 : _b.name) || !((_c = result.data) === null || _c === void 0 ? void 0 : _c.phone_number)) {
47
- console.log('useLoginUuidSync: 로그인 안 됨');
47
+ // console.log('useLoginUuidSync: 로그인 안 됨');
48
48
  return;
49
49
  }
50
50
  const idx = result.data.idx;
51
51
  if (!idx) {
52
- console.log('useLoginUuidSync: idx 없음');
52
+ // console.log('useLoginUuidSync: idx 없음');
53
53
  return;
54
54
  }
55
- console.log('useLoginUuidSync: 로그인 확인, idx:', idx);
55
+ // console.log('useLoginUuidSync: 로그인 확인, idx:', idx);
56
56
  // URL에 uuid 추가
57
57
  const url = new URL(window.location.href);
58
58
  url.searchParams.set('uuid', String(idx));
@@ -61,13 +61,13 @@ export const useLoginUuidSync = () => {
61
61
  gtag.event({
62
62
  action: 'login_complete',
63
63
  category: 'login',
64
- label: `로그인 완료 - ${idx}`,
64
+ label: `로그인 이후 돌아온 페이지 ${newUrl} - ${idx}`,
65
65
  value: '1'
66
66
  });
67
67
  hasProcessed.current = true;
68
68
  // URL 업데이트 (히스토리에 추가하지 않고 교체)
69
69
  window.history.replaceState({}, '', newUrl);
70
- console.log('useLoginUuidSync: URL 업데이트 완료', newUrl);
70
+ // console.log('useLoginUuidSync: URL 업데이트 완료', newUrl);
71
71
  }
72
72
  catch (error) {
73
73
  console.error('useLoginUuidSync 에러:', error);
@@ -9,25 +9,25 @@ import * as gtag from '../../lib/gtag';
9
9
  export const useLoginUuidSync = () => {
10
10
  const hasProcessed = useRef(false);
11
11
 
12
- console.log('useLoginUuidSync 훅 호출됨');
12
+ // console.log('useLoginUuidSync 훅 호출됨');
13
13
 
14
14
  useEffect(() => {
15
- console.log('useLoginUuidSync useEffect 실행, hasProcessed:', hasProcessed.current);
15
+ // console.log('useLoginUuidSync useEffect 실행, hasProcessed:', hasProcessed.current);
16
16
 
17
17
  // 이미 처리했으면 스킵
18
18
  if (hasProcessed.current) {
19
- console.log('useLoginUuidSync: 이미 처리됨, 스킵');
19
+ // console.log('useLoginUuidSync: 이미 처리됨, 스킵');
20
20
  return;
21
21
  }
22
22
 
23
23
  const syncUuid = async () => {
24
- console.log('useLoginUuidSync syncUuid 함수 시작');
24
+ // console.log('useLoginUuidSync syncUuid 함수 시작');
25
25
  try {
26
26
  // URL에 이미 uuid가 있으면 스킵
27
27
  const urlParams = new URLSearchParams(window.location.search);
28
- console.log('useLoginUuidSync 현재 URL:', window.location.href);
28
+ // console.log('useLoginUuidSync 현재 URL:', window.location.href);
29
29
  if (urlParams.has('uuid')) {
30
- console.log('useLoginUuidSync: URL에 이미 uuid 있음');
30
+ // console.log('useLoginUuidSync: URL에 이미 uuid 있음');
31
31
  return;
32
32
  }
33
33
 
@@ -38,21 +38,21 @@ export const useLoginUuidSync = () => {
38
38
  credentials: 'include'
39
39
  }).then(res => res.json());
40
40
 
41
- console.log('useLoginUuidSync result:', result);
41
+ // console.log('useLoginUuidSync result:', result);
42
42
 
43
43
  // 로그인 안 됨
44
44
  if (!result.data?.email || !result.data?.name || !result.data?.phone_number) {
45
- console.log('useLoginUuidSync: 로그인 안 됨');
45
+ // console.log('useLoginUuidSync: 로그인 안 됨');
46
46
  return;
47
47
  }
48
48
 
49
49
  const idx = result.data.idx;
50
50
  if (!idx) {
51
- console.log('useLoginUuidSync: idx 없음');
51
+ // console.log('useLoginUuidSync: idx 없음');
52
52
  return;
53
53
  }
54
54
 
55
- console.log('useLoginUuidSync: 로그인 확인, idx:', idx);
55
+ // console.log('useLoginUuidSync: 로그인 확인, idx:', idx);
56
56
 
57
57
  // URL에 uuid 추가
58
58
  const url = new URL(window.location.href);
@@ -63,7 +63,7 @@ export const useLoginUuidSync = () => {
63
63
  gtag.event({
64
64
  action: 'login_complete',
65
65
  category: 'login',
66
- label: `로그인 완료 - ${idx}`,
66
+ label: `로그인 이후 돌아온 페이지 ${newUrl} - ${idx}`,
67
67
  value: '1'
68
68
  });
69
69
 
@@ -71,7 +71,7 @@ export const useLoginUuidSync = () => {
71
71
 
72
72
  // URL 업데이트 (히스토리에 추가하지 않고 교체)
73
73
  window.history.replaceState({}, '', newUrl);
74
- console.log('useLoginUuidSync: URL 업데이트 완료', newUrl);
74
+ // console.log('useLoginUuidSync: URL 업데이트 완료', newUrl);
75
75
  } catch (error) {
76
76
  console.error('useLoginUuidSync 에러:', error);
77
77
  }
@@ -46,19 +46,19 @@ const LoginContainer = ({ layoutClassName = ' relative h-[100vh] max-h-[1200px]
46
46
  });
47
47
  // 로그인 체크 + idx 조회
48
48
  const fetchUserWithIdx = () => __awaiter(void 0, void 0, void 0, function* () {
49
- var _a, _b, _c, _d, _e, _f, _g;
49
+ var _a, _b, _c, _d;
50
50
  try {
51
51
  const result = yield fetch(`/api/lawfirm/app/user`, {
52
52
  method: 'GET',
53
53
  headers: { 'Content-Type': 'application/json' },
54
54
  credentials: 'include'
55
55
  }).then(res => res.json());
56
- console.log('fetchUserWithIdx result:', result);
56
+ // console.log('fetchUserWithIdx result:', result);
57
57
  if (((_a = result.data) === null || _a === void 0 ? void 0 : _a.email) && ((_b = result.data) === null || _b === void 0 ? void 0 : _b.name) && ((_c = result.data) === null || _c === void 0 ? void 0 : _c.phone_number)) {
58
- console.log('로그인 성공, idx:', result.data.idx);
58
+ // console.log('로그인 성공, idx:', result.data.idx);
59
59
  return { isLogin: true, idx: (_d = result.data.idx) !== null && _d !== void 0 ? _d : null };
60
60
  }
61
- console.log('로그인 조건 미충족 - email:', (_e = result.data) === null || _e === void 0 ? void 0 : _e.email, 'name:', (_f = result.data) === null || _f === void 0 ? void 0 : _f.name, 'phone_number:', (_g = result.data) === null || _g === void 0 ? void 0 : _g.phone_number);
61
+ // console.log('로그인 조건 미충족 - email:', result.data?.email, 'name:', result.data?.name, 'phone_number:', result.data?.phone_number);
62
62
  return { isLogin: false, idx: null };
63
63
  }
64
64
  catch (error) {
@@ -81,15 +81,15 @@ const LoginContainer = ({ layoutClassName = ' relative h-[100vh] max-h-[1200px]
81
81
  return redirect;
82
82
  }
83
83
  };
84
- // GA 이벤트: 로그인 완료
85
- const loginCompleteGAEvent = (userId) => {
86
- gtag.event({
87
- action: 'login_complete',
88
- category: 'login',
89
- label: `로그인 완료 - ${userId}`,
90
- value: '1'
91
- });
92
- };
84
+ // GA 이벤트: 로그인 완료 (useLoginUuidSync.ts 훅에서 처리)
85
+ // const loginCompleteGAEvent = (userId: string) => {
86
+ // gtag.event({
87
+ // action: 'login_complete',
88
+ // category: 'login',
89
+ // label: `로그인 완료 - ${userId}`,
90
+ // value: '1'
91
+ // });
92
+ // };
93
93
  useEffect(() => {
94
94
  if (!isCheckRecentLogin) {
95
95
  return;
@@ -115,13 +115,13 @@ const LoginContainer = ({ layoutClassName = ' relative h-[100vh] max-h-[1200px]
115
115
  checkLogoutLogAction();
116
116
  }, []);
117
117
  useEffect(() => {
118
- console.log('로그인 체크 useEffect 시작');
118
+ // console.log('로그인 체크 useEffect 시작');
119
119
  let attemptCount = 0; // 시도 횟수
120
120
  const maxAttempts = 3; // 최대 4번
121
121
  const intervalTime = 3000; // 3초
122
122
  const interval = setInterval(() => __awaiter(void 0, void 0, void 0, function* () {
123
123
  attemptCount++;
124
- console.log(`로그인 체크 시도 ${attemptCount}/${maxAttempts}`);
124
+ // console.log(`로그인 체크 시도 ${attemptCount}/${maxAttempts}`);
125
125
  try {
126
126
  const { isLogin, idx } = yield fetchUserWithIdx();
127
127
  if (isLogin) {
@@ -129,7 +129,7 @@ const LoginContainer = ({ layoutClassName = ' relative h-[100vh] max-h-[1200px]
129
129
  const normalized = redirect ? (redirect.startsWith('/') ? redirect : `/${redirect}`) : '/';
130
130
  const finalUrl = appendUuidToRedirect(normalized, String(idx !== null && idx !== void 0 ? idx : ''));
131
131
  // GA 이벤트
132
- loginCompleteGAEvent(String(idx !== null && idx !== void 0 ? idx : ''));
132
+ // loginCompleteGAEvent(String(idx ?? '')); useLoginUuidSync.ts 훅에서 처리
133
133
  clearInterval(interval);
134
134
  window.location.href = finalUrl;
135
135
  return;
@@ -159,7 +159,7 @@ const LoginContainer = ({ layoutClassName = ' relative h-[100vh] max-h-[1200px]
159
159
  const normalized = redirect ? (redirect.startsWith('/') ? redirect : `/${redirect}`) : '/';
160
160
  const finalUrl = appendUuidToRedirect(normalized, String(idx !== null && idx !== void 0 ? idx : ''));
161
161
  // GA 이벤트
162
- loginCompleteGAEvent(String(idx !== null && idx !== void 0 ? idx : ''));
162
+ // loginCompleteGAEvent(String(idx ?? '')); useLoginUuidSync.ts 훅에서 처리
163
163
  window.location.href = finalUrl;
164
164
  }
165
165
  else {
@@ -61,13 +61,13 @@ const LoginContainer = ({
61
61
  credentials: 'include'
62
62
  }).then(res => res.json());
63
63
 
64
- console.log('fetchUserWithIdx result:', result);
64
+ // console.log('fetchUserWithIdx result:', result);
65
65
 
66
66
  if (result.data?.email && result.data?.name && result.data?.phone_number) {
67
- console.log('로그인 성공, idx:', result.data.idx);
67
+ // console.log('로그인 성공, idx:', result.data.idx);
68
68
  return { isLogin: true, idx: result.data.idx ?? null };
69
69
  }
70
- console.log('로그인 조건 미충족 - email:', result.data?.email, 'name:', result.data?.name, 'phone_number:', result.data?.phone_number);
70
+ // console.log('로그인 조건 미충족 - email:', result.data?.email, 'name:', result.data?.name, 'phone_number:', result.data?.phone_number);
71
71
  return { isLogin: false, idx: null };
72
72
  } catch (error) {
73
73
  console.error('fetchUserWithIdx 에러:', error);
@@ -88,15 +88,15 @@ const LoginContainer = ({
88
88
  }
89
89
  };
90
90
 
91
- // GA 이벤트: 로그인 완료
92
- const loginCompleteGAEvent = (userId: string) => {
93
- gtag.event({
94
- action: 'login_complete',
95
- category: 'login',
96
- label: `로그인 완료 - ${userId}`,
97
- value: '1'
98
- });
99
- };
91
+ // GA 이벤트: 로그인 완료 (useLoginUuidSync.ts 훅에서 처리)
92
+ // const loginCompleteGAEvent = (userId: string) => {
93
+ // gtag.event({
94
+ // action: 'login_complete',
95
+ // category: 'login',
96
+ // label: `로그인 완료 - ${userId}`,
97
+ // value: '1'
98
+ // });
99
+ // };
100
100
 
101
101
  useEffect(() => {
102
102
  if (!isCheckRecentLogin) {
@@ -123,14 +123,14 @@ const LoginContainer = ({
123
123
  }, []);
124
124
 
125
125
  useEffect(() => {
126
- console.log('로그인 체크 useEffect 시작');
126
+ // console.log('로그인 체크 useEffect 시작');
127
127
  let attemptCount = 0; // 시도 횟수
128
128
  const maxAttempts = 3; // 최대 4번
129
129
  const intervalTime = 3000; // 3초
130
130
 
131
131
  const interval = setInterval(async () => {
132
132
  attemptCount++;
133
- console.log(`로그인 체크 시도 ${attemptCount}/${maxAttempts}`);
133
+ // console.log(`로그인 체크 시도 ${attemptCount}/${maxAttempts}`);
134
134
 
135
135
  try {
136
136
  const { isLogin, idx } = await fetchUserWithIdx();
@@ -141,7 +141,7 @@ const LoginContainer = ({
141
141
  const finalUrl = appendUuidToRedirect(normalized, String(idx ?? ''));
142
142
 
143
143
  // GA 이벤트
144
- loginCompleteGAEvent(String(idx ?? ''));
144
+ // loginCompleteGAEvent(String(idx ?? '')); useLoginUuidSync.ts 훅에서 처리
145
145
 
146
146
  clearInterval(interval);
147
147
  window.location.href = finalUrl;
@@ -177,7 +177,7 @@ const LoginContainer = ({
177
177
  const finalUrl = appendUuidToRedirect(normalized, String(idx ?? ''));
178
178
 
179
179
  // GA 이벤트
180
- loginCompleteGAEvent(String(idx ?? ''));
180
+ // loginCompleteGAEvent(String(idx ?? '')); useLoginUuidSync.ts 훅에서 처리
181
181
 
182
182
  window.location.href = finalUrl;
183
183
  } else {
@@ -242,11 +242,11 @@ const StepOne = () => {
242
242
  }),
243
243
  onSuccess: (data) => {
244
244
  var _a, _b;
245
- console.log('data: ', data);
245
+ // console.log('data: ', data);
246
246
  const userIdx = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.idx;
247
247
  const redirect = decodeURIComponent(getCookie('redirect')) || '/';
248
248
  const newRedirect = appendUuidToRedirect(redirect, String(userIdx !== null && userIdx !== void 0 ? userIdx : ''));
249
- console.log('newRedirect:', newRedirect);
249
+ // console.log('newRedirect:', newRedirect);
250
250
  setCookie({ key: 'redirect', value: newRedirect });
251
251
  setModalObj({ title: '회원가입이 완료되었습니다.', subTitle: '' });
252
252
  setIsModal(true);
@@ -310,12 +310,12 @@ const StepOne = () => {
310
310
  };
311
311
  },
312
312
  onSuccess: (data) => {
313
- console.log('data: ', data);
313
+ // console.log('data: ', data);
314
314
  const userIdx = data?.user?.data?.idx;
315
315
 
316
316
  const redirect = decodeURIComponent(getCookie('redirect')) || '/';
317
317
  const newRedirect = appendUuidToRedirect(redirect, String(userIdx ?? ''));
318
- console.log('newRedirect:', newRedirect);
318
+ // console.log('newRedirect:', newRedirect);
319
319
 
320
320
  setCookie({ key: 'redirect', value: newRedirect });
321
321
  setModalObj({ title: '회원가입이 완료되었습니다.', subTitle: '' });
@@ -281,11 +281,11 @@ const StepTwo = () => {
281
281
  }),
282
282
  onSuccess: (data) => {
283
283
  var _a, _b;
284
- console.log('data: ', data);
284
+ // console.log('data: ', data);
285
285
  const userIdx = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.idx;
286
286
  const redirect = decodeURIComponent(getCookie('redirect')) || '/';
287
287
  const newRedirect = appendUuidToRedirect(redirect, String(userIdx !== null && userIdx !== void 0 ? userIdx : ''));
288
- console.log('newRedirect:', newRedirect);
288
+ // console.log('newRedirect:', newRedirect);
289
289
  setCookie({ key: 'redirect', value: newRedirect });
290
290
  setModalObj({ title: '회원가입이 완료되었습니다.', subTitle: '' });
291
291
  setIsModal(true);
@@ -350,12 +350,12 @@ const StepTwo = () => {
350
350
  };
351
351
  },
352
352
  onSuccess: (data) => {
353
- console.log('data: ', data);
353
+ // console.log('data: ', data);
354
354
  const userIdx = data?.user?.data?.idx;
355
355
 
356
356
  const redirect = decodeURIComponent(getCookie('redirect')) || '/';
357
357
  const newRedirect = appendUuidToRedirect(redirect, String(userIdx ?? ''));
358
- console.log('newRedirect:', newRedirect);
358
+ // console.log('newRedirect:', newRedirect);
359
359
 
360
360
  setCookie({ key: 'redirect', value: newRedirect });
361
361
  setModalObj({ title: '회원가입이 완료되었습니다.', subTitle: '' });