송용우 vor 5 Monaten
Ursprung
Commit
eb63332a95
1 geänderte Dateien mit 37 neuen und 3 gelöschten Zeilen
  1. 37 3
      pages/index.vue

+ 37 - 3
pages/index.vue

@@ -78,8 +78,8 @@
           <v-btn class="custom-btn text--btn" @click="location('join')">회원가입</v-btn>
         </div>
         <div class="short--login--wrap">
-          <v-btn class="btn--google" @click="onGoogleLogin"></v-btn>
-          <v-btn class="btn--kakao"></v-btn>
+          <v-btn class="btn--google" @click.stop="onGoogleLogin"></v-btn>
+          <v-btn class="btn--kakao" @click.stop="onKakaoLogin"></v-btn>
           <v-btn class="btn--naver"></v-btn>
         </div>
       </div>
@@ -342,6 +342,7 @@
 
   // onMounted
   onMounted(() => {
+    //구글 인증 프로세스
     function handleMessage(event) {
       // 개발환경이면 아래처럼 확인
       if (
@@ -431,7 +432,7 @@
     $eventBus.emit("OPEN_CONFIRM_POP_UP", param);
   };
 
-  // 구글 로그인 버튼 클릭 시 호출
+  // 구글 로그인 인증 시퀀스
   function onGoogleLogin() {
     const clientId =
       "373780605211-diojebh7mug45urv9rnqdil6n0b1ogge.apps.googleusercontent.com"; // 실제 클라이언트 ID로 교체
@@ -473,6 +474,39 @@
     );
   }
 
+  //카카오 인증 시퀀스
+  function onKakaoLogin() {
+    const kakaoAuthUrl = "https://shopdeli.mycafe24.com/auth/kakaoLogin"; // 실제 리디렉션 URI로 교체
+
+    const width = 500;
+    const height = 600;
+    const dualScreenLeft =
+      window.screenLeft !== undefined ? window.screenLeft : window.screenX;
+    const dualScreenTop =
+      window.screenTop !== undefined ? window.screenTop : window.screenY;
+
+    const currentWidth = window.innerWidth
+      ? window.innerWidth
+      : document.documentElement.clientWidth
+      ? document.documentElement.clientWidth
+      : screen.width;
+
+    const currentHeight = window.innerHeight
+      ? window.innerHeight
+      : document.documentElement.clientHeight
+      ? document.documentElement.clientHeight
+      : screen.height;
+
+    const left = dualScreenLeft + (currentWidth - width) / 2;
+    const top = dualScreenTop + (currentHeight - height) / 2;
+
+    window.open(
+      kakaoAuthUrl,
+      "kakaoLogin",
+      `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=yes`
+    );
+  }
+
   /**
    * @API
    * 최종 로그인 버튼 클릭 시 API