Răsfoiți Sursa

+ 로그인 env 수정

송용우 5 luni în urmă
părinte
comite
e65e293789
4 a modificat fișierele cu 62 adăugiri și 60 ștergeri
  1. 2 2
      .env.development
  2. 1 1
      middleware/auth.global.js
  3. 1 1
      pages/auth/join.vue
  4. 58 56
      pages/index.vue

+ 2 - 2
.env.development

@@ -1,8 +1,8 @@
 #import.meta.env로 호출 가능
 VITE_APP_BASE_URL="/"
-VITE_APP_API_URL="http://localhost:3000"
+VITE_APP_API_URL="https://shopdeli.mycafe24.com"
 VITE_APP_API_PORT=8080
-VITE_APP_API_DOMAIN="https://shopdeli.mycafe24.com"
+VITE_APP_API_DOMAIN="http://localhost:3000"
 VITE_APP_DEBUG_LEVEL=trace
 VITE_APP_MODE=development
 VITE_APP_KAKAO_APP_KEY=""

+ 1 - 1
middleware/auth.global.js

@@ -6,7 +6,7 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
   const tokenPassPages = [
     '/', 
     '/roulette',    
-    '/auth'    
+    '/auth',    
   ]
   //let accountValue = useAuthStore().getAccountRole.charAt(0).toUpperCase()
 

+ 1 - 1
pages/auth/join.vue

@@ -460,7 +460,7 @@
           // SNS 가입일 경우
           useStore.setTempData("");
         }
-        useUtil.setPageMove("/");
+        //useUtil.setPageMove("/");
       })
       .catch((error) => {
         if (error.response) {

+ 58 - 56
pages/index.vue

@@ -1,11 +1,11 @@
 <template>
   <div class="login-wrap">
-    <!-- <div class="login--gate" v-show="loginVisible == 'Y'">
+    <div class="login--gate" v-show="loginVisible == 'Y'">
       <div
         class="inf--gate"
         :class="gate1 ? 'actv' : ''"
         @mousemove.stop="handleInfluenceMove"
-      >        
+      >
         <div class="btn--contents">
           <h2>influence</h2>
           <v-btn class="loc--btn" @click.stop="location('influence')"
@@ -17,7 +17,7 @@
         class="ven--gate"
         :class="gate2 ? 'actv' : ''"
         @mousemove.stop="handleVendorMove"
-      >        
+      >
         <div class="btn--contents">
           <h2>vendor</h2>
           <v-btn class="loc--btn" @click.stop="location('vendor')">Discover more ></v-btn>
@@ -26,9 +26,6 @@
     </div>
 
     <div class="login--cock" v-show="loginVisible == 'N'">
-     -->
-
-    <div class="login--cock">
       <!-- header -->
       <div class="login--header">
         <div class="login--header--l">
@@ -95,9 +92,17 @@
 
           <div class="login-btn-wrap">
             <v-btn
+              v-if="loginForm.loginType == 'influence'"
+              class="custom-btn btn-blue"
+              @keyup.enter="loginAction(loginForm.userId, loginForm.passwd, 'influence')"
+              @click="loginAction(loginForm.userId, loginForm.passwd, 'influence')"
+              >로그인</v-btn
+            >
+            <v-btn
+              v-else-if="loginForm.loginType == 'vendor'"
               class="custom-btn btn-blue"
-              @keyup.enter="loginAction(loginForm.userId, loginForm.passwd)"
-              @click="loginAction(loginForm.userId, loginForm.passwd)"
+              @keyup.enter="loginAction(loginForm.userId, loginForm.passwd, 'vendor')"
+              @click="loginAction(loginForm.userId, loginForm.passwd, 'vendor')"
               >로그인</v-btn
             >
           </div>
@@ -106,8 +111,7 @@
             <v-btn class="custom-btn text--btn">비밀번호 찾기</v-btn>
             <v-btn class="custom-btn text--btn" @click="location('join')">회원가입</v-btn>
           </div>
-          <!-- <div class="short--login--wrap" v-if="loginForm.loginType == 'influence'"> -->
-          <div class="short--login--wrap">
+          <div class="short--login--wrap" v-if="loginForm.loginType == 'influence'">
             <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" @click.stop="onNaverLogin"></v-btn>
@@ -168,43 +172,6 @@
   let listObj = ref({
     langTypeList: {},
   });
-
-  const handleInfluenceMove = (event) => {
-    const el = event.currentTarget;
-    const rect = el.getBoundingClientRect();
-    const mouseX = event.clientX;
-
-    // 요소 너비의 15%를 좌우 여백으로 계산 (중앙 70% 영역)
-    const margin = rect.width * 0.15;
-    const leftBound = rect.left + margin;
-    const rightBound = rect.right - margin;
-
-    if (mouseX >= leftBound && mouseX <= rightBound) {
-      gate1.value = true;
-      gate2.value = false;
-    } else {
-      gate1.value = false;
-    }
-  };
-
-  const handleVendorMove = (event) => {
-    const el = event.currentTarget;
-    const rect = el.getBoundingClientRect();
-    const mouseX = event.clientX;
-
-    // 요소 너비의 15%를 좌우 여백으로 계산 (중앙 70% 영역)
-    const margin = rect.width * 0.15;
-    const leftBound = rect.left + margin;
-    const rightBound = rect.right - margin;
-
-    if (mouseX >= leftBound && mouseX <= rightBound) {
-      gate2.value = true;
-      gate1.value = false;
-    } else {
-      gate2.value = false;
-    }
-  };
-
   // 로그인 정보
   const loginForm = ref({
     userId: "",
@@ -340,6 +307,42 @@
     loginForm.value.userId = saveId;
   }
 
+  const handleInfluenceMove = (event) => {
+    const el = event.currentTarget;
+    const rect = el.getBoundingClientRect();
+    const mouseX = event.clientX;
+
+    // 요소 너비의 15%를 좌우 여백으로 계산 (중앙 70% 영역)
+    const margin = rect.width * 0.15;
+    const leftBound = rect.left + margin;
+    const rightBound = rect.right - margin;
+
+    if (mouseX >= leftBound && mouseX <= rightBound) {
+      gate1.value = true;
+      gate2.value = false;
+    } else {
+      gate1.value = false;
+    }
+  };
+
+  const handleVendorMove = (event) => {
+    const el = event.currentTarget;
+    const rect = el.getBoundingClientRect();
+    const mouseX = event.clientX;
+
+    // 요소 너비의 15%를 좌우 여백으로 계산 (중앙 70% 영역)
+    const margin = rect.width * 0.15;
+    const leftBound = rect.left + margin;
+    const rightBound = rect.right - margin;
+
+    if (mouseX >= leftBound && mouseX <= rightBound) {
+      gate2.value = true;
+      gate1.value = false;
+    } else {
+      gate2.value = false;
+    }
+  };
+
   // 개인정보처리방침 이용약관 팝업
   //const privacyPop = ref(false);
   const privacyDetail = ref({
@@ -356,10 +359,11 @@
     mode: "",
   });
 
-  const loginAction = (__ID, __PASS) => {
+  const loginAction = (__ID, __PASS, __TYPE) => {
     let _req = {
       id: __ID,
       password: __PASS,
+      logintype: __TYPE,
     };
 
     useAxios()
@@ -412,7 +416,7 @@
         break;
       case "influence":
         useUtil.setPageMove("/?type=influence");
-        loginVisible.value = "N";
+        loginVisible.value = "Y";
         break;
       case "vendor":
         useUtil.setPageMove("/?type=vendor");
@@ -437,7 +441,7 @@
 
     //구글 인증 프로세스
     function handleMessage(event) {
-      const appBaseUrl = import.meta.env.VITE_APP_BASE_URL;
+      const appBaseUrl = import.meta.env.VITE_APP_API_URL;
       // 개발환경이면 아래처럼 확인
       const allowedOrigins = [
         "http://0.0.0.0:3000",
@@ -449,7 +453,7 @@
 
         if (user?.JOIN === "1") {
           useAuthStore().setTempData(user);
-          useUtil.setPageMove("/auth/join");
+          useUtil.setPageMove("/auth/join?type=" + loginForm.value.loginType);
         } else {
           //useAuthStore().setAuth(res.data);
 
@@ -478,7 +482,6 @@
     onBeforeUnmount(() => window.removeEventListener("message", handleMessage));
   });
 
-  /*
   watch(
     () => route.query.type,
     (newType) => {
@@ -493,7 +496,6 @@
       immediate: true, // 컴포넌트가 마운트될 때 즉시 실행
     }
   );
-  */
 
   watchEffect(() => {
     // 감시하고자 하는 데이터를 해당 블럭내에서 사용하면 호출된다.
@@ -547,7 +549,7 @@
 
   // 구글 로그인 인증 시퀀스
   function onGoogleLogin() {
-    const appBaseUrl = import.meta.env.VITE_APP_API_DOMAIN;
+    const appBaseUrl = import.meta.env.VITE_APP_API_URL;
     const clientId =
       "373780605211-diojebh7mug45urv9rnqdil6n0b1ogge.apps.googleusercontent.com"; // 실제 클라이언트 ID로 교체
     //const redirectUri = "https://shopdeli.mycafe24.com/auth/callback"; // 실제 리디렉션 URI로 교체
@@ -591,7 +593,7 @@
 
   //카카오 인증 시퀀스
   function onKakaoLogin() {
-    const appBaseUrl = import.meta.env.VITE_APP_API_DOMAIN;
+    const appBaseUrl = import.meta.env.VITE_APP_API_URL;
     const kakaoAuthUrl = `${appBaseUrl}/auth/kakaoLogin`; // 실제 리디렉션 URI로 교체
 
     const width = 500;
@@ -625,7 +627,7 @@
 
   //네이버 인증 시퀀스
   function onNaverLogin() {
-    const appBaseUrl = import.meta.env.VITE_APP_BASE_URL;
+    const appBaseUrl = import.meta.env.VITE_APP_API_URL;
     const naverAuthUrl = `${appBaseUrl}/auth/naverLogin`; // 실제 리디렉션 URI로 교체
 
     const width = 500;