|
|
@@ -73,7 +73,9 @@
|
|
|
>
|
|
|
</div>
|
|
|
<div class="short--login--wrap">
|
|
|
- <v-btn @click="onGoogleLogin">구글 로그인</v-btn>
|
|
|
+ <v-btn class="btn--google" @click="onGoogleLogin"></v-btn>
|
|
|
+ <v-btn class="btn--kakao"></v-btn>
|
|
|
+ <v-btn class="btn--naver"></v-btn>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -317,19 +319,22 @@ import { useI18n } from "vue-i18n";
|
|
|
|
|
|
// onMounted
|
|
|
onMounted(() => {
|
|
|
- //loginForm.value.userAgent = $userAgent;
|
|
|
- // if (loginForm.value.authType === "GOOGLE") {
|
|
|
- // selectPlaceholder.value = i18n.t("login.googleOTPNum");
|
|
|
- // } else if (loginForm.value.authType === "EMAIL") {
|
|
|
- // selectPlaceholder.value = i18n.t("login.emailAuthNum");
|
|
|
- // } else {
|
|
|
- // selectPlaceholder.value = i18n.t("login.smsAuthNum");
|
|
|
- // }
|
|
|
- // let saveId = localStorage.getItem("saveId");
|
|
|
- // if (saveId) {
|
|
|
- // checkbox.value = true;
|
|
|
- // loginForm.value.username = saveId;
|
|
|
- // }
|
|
|
+ const handler = (event) => {
|
|
|
+ if (event.origin !== "https://shopdeli.mycafe24.com") return;
|
|
|
+ if (event.data?.accessToken) {
|
|
|
+ useAuthStore().setAuth(event.data);
|
|
|
+ useAuthStore().setAccessToken(event.data.accessToken);
|
|
|
+ useAuthStore().setRefreshToken(event.data.refreshToken);
|
|
|
+ localStorage.setItem("tempAccess", event.data.user?.ID);
|
|
|
+ useUtil.setPageMove("/view/event/evtList");
|
|
|
+ useStore.menuInfo.menuIndex = "0";
|
|
|
+ useStore.menuInfo.menuId = "menu02";
|
|
|
+ useStore.menuInfo.pageRtName = "이벤트 관리";
|
|
|
+ useStore.menuInfo.pageStatus = null;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ window.addEventListener("message", handler);
|
|
|
+ onBeforeUnmount(() => window.removeEventListener("message", handler));
|
|
|
});
|
|
|
|
|
|
watchEffect(() => {
|
|
|
@@ -805,14 +810,40 @@ import { useI18n } from "vue-i18n";
|
|
|
"373780605211-diojebh7mug45urv9rnqdil6n0b1ogge.apps.googleusercontent.com"; // 실제 클라이언트 ID로 교체
|
|
|
const redirectUri = "https://shopdeli.mycafe24.com/auth/callback"; // 실제 리디렉션 URI로 교체
|
|
|
const scope = "openid email profile";
|
|
|
- const responseType = "token"; // 또는 'code' (백엔드 연동 시)
|
|
|
+ const responseType = "code"; // 또는 'code' (백엔드 연동 시)
|
|
|
const state = Math.random().toString(36).substring(2);
|
|
|
|
|
|
const googleAuthUrl = `https://accounts.google.com/o/oauth2/v2/auth?client_id=${clientId}&redirect_uri=${encodeURIComponent(
|
|
|
redirectUri
|
|
|
)}&response_type=${responseType}&scope=${encodeURIComponent(scope)}&state=${state}`;
|
|
|
|
|
|
- window.location.href = googleAuthUrl;
|
|
|
+ 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(
|
|
|
+ googleAuthUrl,
|
|
|
+ "googleLogin",
|
|
|
+ `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=yes`
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
/**
|