index.vue 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687
  1. <template>
  2. <div class="login-wrap">
  3. <div class="login--gate" v-show="loginVisible == 'Y'">
  4. <div class="gate-container">
  5. <div
  6. class="gate-card influencer-gate"
  7. :class="gate1 ? 'actv' : ''"
  8. @mouseover="handleInfluenceMove"
  9. @click.stop="location('influence')"
  10. @mouseleave="gate1 = false"
  11. >
  12. <div class="gate-icon">
  13. <div class="icon-circle influencer-bg">
  14. ❤️
  15. </div>
  16. </div>
  17. <div class="gate-content">
  18. <h3>인플루언서</h3>
  19. <p>크리에이터와 함께하세요</p>
  20. </div>
  21. </div>
  22. <div
  23. @click.stop="location('vendor')"
  24. class="gate-card vendor-gate"
  25. :class="gate2 ? 'actv' : ''"
  26. @mouseover="handleVendorMove"
  27. @mouseleave="gate2 = false"
  28. >
  29. <div class="gate-icon">
  30. <div class="icon-circle vendor-bg">
  31. 🛍️
  32. </div>
  33. </div>
  34. <div class="gate-content" >
  35. <h3>벤더사</h3>
  36. <p>상품을 판매해보세요</p>
  37. </div>
  38. </div>
  39. <div
  40. @click.stop="location('brand')"
  41. class="gate-card brand-gate"
  42. :class="gate3 ? 'actv' : ''"
  43. @mouseover="handleBrandMove"
  44. @mouseleave="gate3 = false"
  45. >
  46. <div class="gate-icon">
  47. <div class="icon-circle brand-bg">
  48. 💎
  49. </div>
  50. </div>
  51. <div class="gate-content">
  52. <h3>브랜드사</h3>
  53. <p>브랜드를 성장시켜보세요</p>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. <div class="login--cock" v-show="loginVisible == 'N'">
  59. <!-- header -->
  60. <div class="login--header">
  61. <div class="login--header--l">
  62. <div class="logo">
  63. SHOPDELI
  64. </div>
  65. </div>
  66. <div class="login--header--r"></div>
  67. </div>
  68. <!-- login -->
  69. <div class="login-box">
  70. <div class="login-l">
  71. <div class="login-l-center">
  72. <span class="logo">
  73. <!-- prettier-ignore -->
  74. SHOPDELI
  75. </span>
  76. <!-- <p>We Make Scalable Mobility Life</p> -->
  77. </div>
  78. </div>
  79. <div class="login-r">
  80. <div class="tit-login">
  81. <strong>{{ route.query.type == 'brand' ? '브랜드사' : route.query.type == 'vendor' ? '벤더사' : '' }} 로그인</strong>
  82. </div>
  83. <div class="login-input-wrap">
  84. <div
  85. class="txt-field-box"
  86. :class="!loginForm.validCheck.input.userId ? 'error' : ''"
  87. >
  88. <v-text-field
  89. v-model="loginForm.userId"
  90. placeholder="아이디를 입력해주세요"
  91. class="custom-input"
  92. @keyup.enter="
  93. loginAction(loginForm.userId, loginForm.passwd, loginForm.loginType)
  94. "
  95. @input="setInputField('main_userId')"
  96. ></v-text-field>
  97. <i class="ico"></i>
  98. </div>
  99. <div
  100. class="txt-field-box"
  101. :class="!loginForm.validCheck.input.passwd ? 'error' : ''"
  102. >
  103. <v-text-field
  104. v-model="loginForm.passwd"
  105. :type="visible ? 'text' : 'password'"
  106. placeholder="비밀번호를 입력해주세요"
  107. class="custom-input"
  108. id="password"
  109. @keyup.enter="
  110. loginAction(loginForm.userId, loginForm.passwd, loginForm.loginType)
  111. "
  112. @input="setInputField('main_passwd')"
  113. ></v-text-field>
  114. <i
  115. class="ico-eye"
  116. @click.stop="toggleVisibility"
  117. :class="visible ? 'eye-on' : 'eye-off'"
  118. ></i>
  119. <i class="ico"></i>
  120. </div>
  121. <!-- <p class="error-txt" v-if="!loginForm.validCheck.inputErrorCheck">
  122. {{ loginForm.validCheck.passwd }}
  123. </p> -->
  124. </div>
  125. <div class="login-btn-wrap">
  126. <v-btn
  127. v-if="loginForm.loginType == 'influence'"
  128. class="custom-btn btn-blue"
  129. @keyup.enter="loginAction(loginForm.userId, loginForm.passwd, 'influence')"
  130. @click="loginAction(loginForm.userId, loginForm.passwd, 'influence')"
  131. >로그인</v-btn
  132. >
  133. <v-btn
  134. v-else-if="loginForm.loginType == 'vendor'"
  135. class="custom-btn btn-blue"
  136. @keyup.enter="loginAction(loginForm.userId, loginForm.passwd, 'vendor')"
  137. @click="loginAction(loginForm.userId, loginForm.passwd, 'vendor')"
  138. >로그인</v-btn
  139. >
  140. <v-btn
  141. v-else-if="loginForm.loginType == 'brand'"
  142. class="custom-btn btn-blue"
  143. @keyup.enter="loginAction(loginForm.userId, loginForm.passwd, 'brand')"
  144. @click="loginAction(loginForm.userId, loginForm.passwd, 'brand')"
  145. >로그인</v-btn
  146. >
  147. </div>
  148. <div class="join--btn--wrap">
  149. <v-btn class="custom-btn text--btn" @click="openFindIdModal">아이디 찾기</v-btn>
  150. <v-btn class="custom-btn text--btn" @click="openFindPwModal">비밀번호 찾기</v-btn>
  151. <v-btn class="custom-btn text--btn" @click="location('join')">회원가입</v-btn>
  152. </div>
  153. <div class="short--login--wrap" v-if="loginForm.loginType == 'influence'">
  154. <v-btn class="btn--google" @click.stop="onGoogleLogin"></v-btn>
  155. <v-btn class="btn--kakao" @click.stop="onKakaoLogin"></v-btn>
  156. <v-btn class="btn--naver" @click.stop="onNaverLogin"></v-btn>
  157. </div>
  158. </div>
  159. </div>
  160. <!-- footer -->
  161. <div class="login-footer">
  162. <div class="login--footer--l">
  163. <p>COPYRIGHT@2025 SHOPDELI INC. ALL RIGHTS RESERVED.</p>
  164. <p>마포구 합정동</p>
  165. </div>
  166. </div>
  167. </div>
  168. <!-- 아이디 찾기 모달 -->
  169. <v-dialog v-model="showFindIdModal" max-width="600px" persistent>
  170. <v-card class="inquiry-modal">
  171. <v-card-title class="modal-header">
  172. <h3>아이디 찾기</h3>
  173. <v-btn icon @click="closeFindIdModal" class="close-btn">
  174. <v-icon>mdi-close</v-icon>
  175. </v-btn>
  176. </v-card-title>
  177. <v-card-text class="modal-body">
  178. <form @submit.prevent="findUserId">
  179. <div class="form-group">
  180. <label>이름 <span class="required">*</span></label>
  181. <v-text-field
  182. v-model="findIdForm.name"
  183. variant="outlined"
  184. hide-details
  185. placeholder="이름을 입력해주세요"
  186. class="custom-input"
  187. :error="!findIdValidation.name"
  188. ></v-text-field>
  189. </div>
  190. <div class="form-group mb--0">
  191. <label>이메일 <span class="required">*</span></label>
  192. <div class="email-input-group">
  193. <v-text-field
  194. v-model="findIdForm.emailLocal"
  195. variant="outlined"
  196. hide-details
  197. placeholder="이메일"
  198. class="custom-input email-local"
  199. :error="!findIdValidation.email"
  200. ></v-text-field>
  201. <span class="email-at">@</span>
  202. <v-combobox
  203. v-model="findIdForm.emailDomain"
  204. :items="['gmail.com', 'naver.com', 'daum.net', 'hotmail.com', 'yahoo.com']"
  205. hide-details
  206. variant="outlined"
  207. placeholder="도메인 선택"
  208. class="custom-select email-domain"
  209. :error="!findIdValidation.email"
  210. ></v-combobox>
  211. </div>
  212. </div>
  213. <div class="form-group" style="display: none;">
  214. <label>회원 유형 <span class="required">*</span></label>
  215. <v-select
  216. v-model="findIdForm.memberType"
  217. :items="findIdMemberTypes"
  218. readonly="true"
  219. variant="outlined"
  220. placeholder="회원 유형을 선택해주세요"
  221. class="custom-select"
  222. ></v-select>
  223. </div>
  224. </form>
  225. </v-card-text>
  226. <v-card-actions class="modal-footer">
  227. <v-btn @click="closeFindIdModal" class="cancel-btn">취소</v-btn>
  228. <v-btn @click="findUserId" class="submit-btn" :loading="findIdLoading">아이디 찾기</v-btn>
  229. </v-card-actions>
  230. </v-card>
  231. </v-dialog>
  232. <!-- 아이디 찾기 결과 모달 -->
  233. <v-dialog v-model="showFindIdResultModal" max-width="600px" persistent>
  234. <v-card class="inquiry-modal">
  235. <v-card-title class="modal-header">
  236. <h3>아이디 찾기 결과</h3>
  237. <v-btn icon @click="closeFindIdResultModal" class="close-btn">
  238. <v-icon>mdi-close</v-icon>
  239. </v-btn>
  240. </v-card-title>
  241. <v-card-text class="modal-body">
  242. <div v-if="foundUserIds.length > 0" class="result-success">
  243. <div class="success-icon">✅</div>
  244. <h4>아이디를 찾았습니다!</h4>
  245. <div class="found-ids">
  246. <div v-for="(user, index) in foundUserIds" :key="index" class="user-info">
  247. <p class="user-id">{{ maskUserId(user.id) }}</p>
  248. <p class="join-date">가입일: {{ formatDate(user.joinDate) }}</p>
  249. </div>
  250. </div>
  251. </div>
  252. <div v-else class="result-error">
  253. <div class="error-icon">❌</div>
  254. <h4>아이디를 찾을 수 없습니다</h4>
  255. <p>입력하신 정보와 일치하는 아이디가 없습니다.<br>정보를 다시 확인해 주세요.</p>
  256. </div>
  257. </v-card-text>
  258. <v-card-actions class="modal-footer">
  259. <v-btn @click="closeFindIdResultModal" class="cancel-btn">닫기</v-btn>
  260. <v-btn v-if="foundUserIds.length > 0" @click="goToLoginFromModal" class="submit-btn">로그인하기</v-btn>
  261. </v-card-actions>
  262. </v-card>
  263. </v-dialog>
  264. <!-- 비밀번호 찾기 모달 -->
  265. <v-dialog v-model="showFindPwModal" max-width="600px" persistent>
  266. <v-card class="inquiry-modal">
  267. <v-card-title class="modal-header">
  268. <h3>비밀번호 찾기</h3>
  269. <v-btn icon @click="closeFindPwModal" class="close-btn">
  270. <v-icon>mdi-close</v-icon>
  271. </v-btn>
  272. </v-card-title>
  273. <v-card-text class="modal-body">
  274. <form @submit.prevent="findUserPw">
  275. <div class="form-group">
  276. <label>이름 <span class="required">*</span></label>
  277. <v-text-field
  278. v-model="findPwForm.name"
  279. variant="outlined"
  280. hide-details
  281. placeholder="이름을 입력해주세요"
  282. class="custom-input"
  283. :error="!findPwValidation.name"
  284. ></v-text-field>
  285. </div>
  286. <div class="form-group">
  287. <label>아이디 <span class="required">*</span></label>
  288. <v-text-field
  289. v-model="findPwForm.userId"
  290. variant="outlined"
  291. hide-details
  292. placeholder="아이디를 입력해주세요"
  293. class="custom-input"
  294. :error="!findPwValidation.userId"
  295. ></v-text-field>
  296. </div>
  297. <div class="form-group mb--0">
  298. <label>이메일 <span class="required">*</span></label>
  299. <div class="email-input-group">
  300. <v-text-field
  301. v-model="findPwForm.emailLocal"
  302. variant="outlined"
  303. hide-details
  304. placeholder="이메일"
  305. class="custom-input email-local"
  306. :error="!findPwValidation.email"
  307. ></v-text-field>
  308. <span class="email-at">@</span>
  309. <v-combobox
  310. v-model="findPwForm.emailDomain"
  311. :items="['gmail.com', 'naver.com', 'daum.net', 'hotmail.com', 'yahoo.com']"
  312. hide-details
  313. variant="outlined"
  314. placeholder="도메인 선택"
  315. class="custom-select email-domain"
  316. :error="!findPwValidation.email"
  317. ></v-combobox>
  318. </div>
  319. </div>
  320. <div class="form-group" style="display: none;">
  321. <label>회원 유형 <span class="required">*</span></label>
  322. <v-select
  323. v-model="findPwForm.memberType"
  324. :items="findIdMemberTypes"
  325. readonly="true"
  326. variant="outlined"
  327. placeholder="회원 유형을 선택해주세요"
  328. class="custom-select"
  329. ></v-select>
  330. </div>
  331. </form>
  332. </v-card-text>
  333. <v-card-actions class="modal-footer">
  334. <v-btn @click="closeFindPwModal" class="cancel-btn">취소</v-btn>
  335. <v-btn @click="findUserPw" class="submit-btn" :loading="findPwLoading">확인</v-btn>
  336. </v-card-actions>
  337. </v-card>
  338. </v-dialog>
  339. <!-- 비밀번호 변경 모달 -->
  340. <v-dialog v-model="showChangePwModal" max-width="600px" persistent>
  341. <v-card class="inquiry-modal">
  342. <v-card-title class="modal-header">
  343. <h3>새 비밀번호 설정</h3>
  344. <v-btn icon @click="closeChangePwModal" class="close-btn">
  345. <v-icon>mdi-close</v-icon>
  346. </v-btn>
  347. </v-card-title>
  348. <v-card-text class="modal-body">
  349. <div class="success-message mb--20">
  350. <div class="success-icon">✅</div>
  351. <p>회원 정보가 확인되었습니다.<br>새로운 비밀번호를 설정해주세요.</p>
  352. </div>
  353. <form @submit.prevent="changePassword">
  354. <div class="form-group">
  355. <label>새 비밀번호 <span class="required">*</span></label>
  356. <v-text-field
  357. v-model="changePwForm.newPassword"
  358. :type="showNewPassword ? 'text' : 'password'"
  359. variant="outlined"
  360. hide-details
  361. placeholder="새 비밀번호를 입력해주세요"
  362. class="custom-input"
  363. :error="!changePwValidation.newPassword"
  364. >
  365. <template v-slot:append-inner>
  366. <v-btn icon size="small" @click="showNewPassword = !showNewPassword">
  367. <v-icon>{{ showNewPassword ? 'mdi-eye-off' : 'mdi-eye' }}</v-icon>
  368. </v-btn>
  369. </template>
  370. </v-text-field>
  371. </div>
  372. <div class="form-group mb--0">
  373. <label>새 비밀번호 확인 <span class="required">*</span></label>
  374. <v-text-field
  375. v-model="changePwForm.confirmPassword"
  376. :type="showConfirmPassword ? 'text' : 'password'"
  377. variant="outlined"
  378. hide-details
  379. placeholder="새 비밀번호를 다시 입력해주세요"
  380. class="custom-input"
  381. :error="!changePwValidation.confirmPassword"
  382. >
  383. <template v-slot:append-inner>
  384. <v-btn icon size="small" @click="showConfirmPassword = !showConfirmPassword">
  385. <v-icon>{{ showConfirmPassword ? 'mdi-eye-off' : 'mdi-eye' }}</v-icon>
  386. </v-btn>
  387. </template>
  388. </v-text-field>
  389. </div>
  390. </form>
  391. </v-card-text>
  392. <v-card-actions class="modal-footer">
  393. <v-btn @click="closeChangePwModal" class="cancel-btn">취소</v-btn>
  394. <v-btn @click="changePassword" class="submit-btn" :loading="changePwLoading">비밀번호 변경</v-btn>
  395. </v-card-actions>
  396. </v-card>
  397. </v-dialog>
  398. </div>
  399. </template>
  400. <script setup>
  401. /************************
  402. * import
  403. ************************/
  404. //import PrivacyPop from "@/components/login/privacyPop.vue";
  405. //import AgrNPop from "@/components/terms/agreeNListPop.vue";
  406. import { useI18n } from "vue-i18n";
  407. /************************
  408. * layout setting
  409. ************************/
  410. definePageMeta({
  411. layout: "loginlayout",
  412. });
  413. /************************
  414. * plugins inject
  415. ************************/
  416. const { $dayjs, $log, $eventBus, $toast, $userAgent } = useNuxtApp();
  417. const useStore = useDetailStore();
  418. const route = useRoute();
  419. /************************
  420. * data & created
  421. ************************/
  422. // 현재 입력 중인 필드를 설정하는 함수
  423. const setInputField = (name) => {
  424. fnValidCheck(name);
  425. };
  426. const pageId = "login";
  427. const gate1 = ref(false);
  428. const gate2 = ref(false);
  429. const gate3 = ref(false);
  430. const loginVisible = ref("N");
  431. const i18n = useI18n();
  432. // 다국어
  433. let listObj = ref({
  434. langTypeList: {},
  435. });
  436. // 로그인 정보
  437. const loginForm = ref({
  438. userId: "",
  439. passwd: "",
  440. otpNum: "",
  441. username: "",
  442. authType: "GOOGLE",
  443. userAgent: "",
  444. loginType: "",
  445. validCheck: {
  446. input: {
  447. userId: true,
  448. passwd: true,
  449. },
  450. otp: {
  451. otpNum: true,
  452. },
  453. inputErrorCheck: true,
  454. inputValidTxt: "",
  455. otpValidTxt: "",
  456. loginValidCheck: false,
  457. btnTxt: "",
  458. btnTxtType: "",
  459. },
  460. });
  461. // 구글 OTP 1차 팝업
  462. const authPop1 = ref({
  463. popYn: false,
  464. certifyYN: false,
  465. userId: "",
  466. passwd: "",
  467. otpNum: "",
  468. validOtpKey: true,
  469. validOtpTxt: "",
  470. btnTxt: "",
  471. btnTxtType: "",
  472. applyBtn: false,
  473. succOtpYn: false,
  474. businessName: "",
  475. agreeChk1: false,
  476. agreeChk2: false,
  477. validCheck: {
  478. userId: true,
  479. passwd: true,
  480. },
  481. validTxt: "",
  482. errorCheck: false,
  483. });
  484. // 구글 OTP 2차 팝업
  485. const authPop2 = ref({
  486. popYn: false,
  487. otpNum: "",
  488. validOtpKey: true,
  489. validOtpTxt: "",
  490. errorCheck: false,
  491. });
  492. // 아이디 찾기 모달
  493. const showFindIdModal = ref(false);
  494. const showFindIdResultModal = ref(false);
  495. const findIdLoading = ref(false);
  496. const foundUserIds = ref([]);
  497. const findIdForm = ref({
  498. name: '',
  499. emailLocal: '',
  500. emailDomain: null, // 빈 문자열 대신 null로 설정
  501. memberType: ''
  502. });
  503. const findIdValidation = ref({
  504. name: true,
  505. email: true
  506. });
  507. const findIdMemberTypes = [
  508. { title: '회원 유형 선택', value: '', disabled: true },
  509. { title: '인플루언서', value: 'influence' },
  510. { title: '벤더사', value: 'vendor' },
  511. { title: '브랜드사', value: 'brand' }
  512. ];
  513. // 비밀번호 찾기 모달
  514. const showFindPwModal = ref(false);
  515. const showChangePwModal = ref(false);
  516. const findPwLoading = ref(false);
  517. const changePwLoading = ref(false);
  518. const foundUser = ref(null);
  519. const findPwForm = ref({
  520. name: '',
  521. userId: '',
  522. emailLocal: '',
  523. emailDomain: null, // 빈 문자열 대신 null로 설정
  524. memberType: ''
  525. });
  526. const findPwValidation = ref({
  527. name: true,
  528. userId: true,
  529. email: true
  530. });
  531. const changePwForm = ref({
  532. newPassword: '',
  533. confirmPassword: ''
  534. });
  535. const changePwValidation = ref({
  536. newPassword: true,
  537. confirmPassword: true
  538. });
  539. const showNewPassword = ref(false);
  540. const showConfirmPassword = ref(false);
  541. // 비밀번호 초기화
  542. const resetPw = ref({
  543. popYn: false,
  544. userId: "",
  545. email: "",
  546. otpNum: "",
  547. validCheck: {
  548. input: {
  549. userId: true,
  550. email: true,
  551. },
  552. otp: {
  553. otpNum: true,
  554. },
  555. inputErrorCheck: true,
  556. inputValidTxt: "",
  557. otpValidTxt: "",
  558. resetPwValidCheck: false,
  559. },
  560. btnTxt: "",
  561. });
  562. // 초기 패스워드 변경
  563. const initPw = ref({
  564. popYn: false,
  565. passwd: "",
  566. passwd2: "",
  567. validCheck: {
  568. passwd: true,
  569. passwd2: true,
  570. },
  571. passwdCheck: false,
  572. errorTxt: "",
  573. });
  574. const selectPlaceholder = ref("");
  575. const initAuthPop1 = ref({});
  576. const initAuthPop2 = ref({});
  577. const initFindId = ref({});
  578. const initResetPw = ref({});
  579. const initInitPw = ref({});
  580. const googleOtpQrCode = ref("");
  581. const googleOtpSecretKey = ref("");
  582. const loginInfo = ref({});
  583. const checkbox = ref(false);
  584. const langType = ref("");
  585. const toggleVisibility = () => {
  586. visible.value = !visible.value;
  587. };
  588. const visible = ref(false);
  589. const isAgrNPop = ref(false);
  590. const isShowAgrNPop = ref(false);
  591. let saveId = localStorage.getItem("saveId");
  592. if (saveId) {
  593. checkbox.value = true;
  594. loginForm.value.userId = saveId;
  595. }
  596. const handleInfluenceMove = (event) => {
  597. gate1.value = true;
  598. gate2.value = false;
  599. gate3.value = false;
  600. };
  601. const handleVendorMove = (event) => {
  602. gate2.value = true;
  603. gate1.value = false;
  604. gate3.value = false;
  605. };
  606. const handleBrandMove = (event) => {
  607. gate3.value = true;
  608. gate1.value = false;
  609. gate2.value = false;
  610. };
  611. // 개인정보처리방침 이용약관 팝업
  612. //const privacyPop = ref(false);
  613. const privacyDetail = ref({
  614. kr: {
  615. title: "",
  616. contents: "",
  617. },
  618. en: {
  619. title: "",
  620. contents: "",
  621. },
  622. });
  623. const systemInfo = ref({
  624. mode: "",
  625. });
  626. const loginAction = (__ID, __PASS, __TYPE) => {
  627. let _req = {
  628. id: __ID,
  629. password: __PASS,
  630. logintype: __TYPE,
  631. };
  632. useAxios()
  633. .post("/roulette/login", _req)
  634. .then((res) => {
  635. if (res.data) {
  636. // console.log(res.data);
  637. useAuthStore().setAuth(res.data);
  638. useAuthStore().setAccessToken(res.data.accessToken);
  639. useAuthStore().setRefreshToken(res.data.refreshToken);
  640. // 디버깅: 로그인 후 사용자 정보 확인
  641. console.log('=== 로그인 성공 디버깅 ===');
  642. console.log('원본 데이터:', res.data);
  643. console.log('설정된 auth 정보:', useAuthStore().auth);
  644. console.log('COMPANY_NUMBER:', useAuthStore().auth.companyNumber);
  645. console.log('memberType:', useAuthStore().auth.memberType);
  646. console.log('===========================');
  647. localStorage.setItem("tempAccess", __ID);
  648. // vendor/brand 타입이면 dashboard로, 그 외에는 기존 item 페이지로
  649. const memberType = useAuthStore().auth.memberType;
  650. if (memberType === 'VENDOR' || memberType === 'BRAND') {
  651. useUtil.setPageMove("/view/common/dashboard");
  652. useStore.menuInfo.menuIndex = "0";
  653. useStore.menuInfo.menuId = "menu00";
  654. useStore.menuInfo.pageRtName = "대시보드";
  655. useStore.menuInfo.pageStatus = null;
  656. } else {
  657. useUtil.setPageMove("/view/common/item");
  658. useStore.menuInfo.menuIndex = "0";
  659. useStore.menuInfo.menuId = "menu01";
  660. useStore.menuInfo.pageRtName = "제품 관리";
  661. useStore.menuInfo.pageStatus = null;
  662. }
  663. }
  664. })
  665. .catch((error) => {
  666. if (error.response) {
  667. console.log("status:", error.response.status, "data:", error.response.data);
  668. // 안전하게 errCode, message 접근
  669. const errData = error.response.data || {};
  670. const errCode = errData.errCode || errData.errorCode || errData.code || "";
  671. const errMsg = errData.message || "알 수 없는 오류가 발생했습니다.";
  672. console.log("errCode:", errCode, "message:", errMsg);
  673. } else {
  674. console.log("error:", error.message, error.code);
  675. }
  676. if (error.response?.status) {
  677. fnLoginSet(error.response.data.messages.message);
  678. }
  679. $log.debug("[login][fnIdPwCheck][error]");
  680. })
  681. .finally(() => {
  682. $log.debug("[login][fnIdPwCheck][finished]");
  683. });
  684. };
  685. const location = (__id) => {
  686. switch (__id) {
  687. case "join":
  688. useUtil.setPageMove("/auth/join?type=" + loginForm.value.loginType);
  689. break;
  690. case "findId":
  691. findId.value.popYn = true;
  692. break;
  693. case "resetPw":
  694. resetPw.value.popYn = true;
  695. break;
  696. case "influence":
  697. useUtil.setPageMove("/?type=influence");
  698. loginVisible.value = "Y";
  699. break;
  700. case "vendor":
  701. useUtil.setPageMove("/?type=vendor");
  702. loginVisible.value = "N";
  703. break;
  704. case "brand":
  705. useUtil.setPageMove("/?type=brand");
  706. loginVisible.value = "N";
  707. break;
  708. default:
  709. break;
  710. }
  711. };
  712. // onMounted
  713. onMounted(() => {
  714. //로그인페이지 접근시 파라미터 체크하여 인플루언서, 밴더 구분
  715. const typeParam = route.query.type;
  716. if (typeParam == "influence") {
  717. loginForm.value.loginType = "influence";
  718. } else if (typeParam == "vendor") {
  719. loginForm.value.loginType = "vendor";
  720. } else if (typeParam == "brand") {
  721. loginForm.value.loginType = "brand";
  722. } else {
  723. loginVisible.value = "Y";
  724. }
  725. //구글 인증 프로세스
  726. function handleMessage(event) {
  727. const appBaseUrl = import.meta.env.VITE_APP_API_URL;
  728. // 개발환경이면 아래처럼 확인
  729. const allowedOrigins = [
  730. "http://0.0.0.0:3000",
  731. "http://localhost:3000",
  732. appBaseUrl,
  733. ].filter(Boolean);
  734. if (allowedOrigins.includes(event.origin)) {
  735. const { accessToken, refreshToken, user } = event.data;
  736. if (user?.JOIN === "1") {
  737. useAuthStore().setTempData(user);
  738. useUtil.setPageMove("/auth/join?type=" + loginForm.value.loginType);
  739. } else {
  740. // SNS 로그인 성공 시 인증 정보 제대로 설정
  741. const authData = {
  742. refreshToken: refreshToken,
  743. user: user,
  744. };
  745. // setAuth를 호출하여 auth 스토어에 사용자 정보 저장
  746. useAuthStore().setAuth(authData);
  747. useAuthStore().setTempData(authData);
  748. useAuthStore().setAccessToken(accessToken);
  749. useAuthStore().setRefreshToken(refreshToken);
  750. localStorage.setItem("tempAccess", user.ID || user.id || user.SEQ);
  751. useUtil.setPageMove("/view/common/item");
  752. useStore.menuInfo.menuIndex = "0";
  753. useStore.menuInfo.menuId = "menu02";
  754. useStore.menuInfo.pageRtName = "이벤트 관리";
  755. useStore.menuInfo.pageStatus = null;
  756. }
  757. }
  758. }
  759. window.addEventListener("message", handleMessage);
  760. onBeforeUnmount(() => window.removeEventListener("message", handleMessage));
  761. });
  762. watch(
  763. () => route.query.type,
  764. (newType) => {
  765. if (newType === "influence" || newType === "vendor" || newType === "brand") {
  766. loginForm.value.loginType = newType;
  767. loginVisible.value = "N"; // 로그인 폼 보이기
  768. } else {
  769. loginVisible.value = "Y"; // 게이트 페이지 보이기
  770. }
  771. },
  772. {
  773. immediate: true, // 컴포넌트가 마운트될 때 즉시 실행
  774. }
  775. );
  776. watchEffect(() => {
  777. // 감시하고자 하는 데이터를 해당 블럭내에서 사용하면 호출된다.
  778. // getLang.value를 감시하는 상태
  779. //QfnGetEnumCode(useLangStore().getLang);
  780. });
  781. // $eventBus.off("SET_SUCCESS_POPUP");
  782. // $eventBus.on("SET_SUCCESS_POPUP", () => {
  783. // // 안내 팝업 확인 클릭 팝업 초기화처리
  784. // fnOtpPopClose("findId");
  785. // fnOtpPopClose("resetPw");
  786. // });
  787. // $eventBus.off("PASSWD_CHANGE");
  788. // $eventBus.on("PASSWD_CHANGE", () => {
  789. // fnPasswdChange();
  790. // });
  791. // $eventBus.off("INIT_PASSWORD");
  792. // $eventBus.on("INIT_PASSWORD", () => {
  793. // initPw.value.popYn = true;
  794. // });
  795. // $eventBus.off("SET_LOGIN");
  796. // $eventBus.on("SET_LOGIN", () => {
  797. // fnLogin();
  798. // });
  799. /************************
  800. * Methods
  801. ************************/
  802. const showComingSoon = () => {
  803. $eventBus.emit('OPEN_CONFIRM_POP_UP', {
  804. id: 'coming-soon',
  805. title: '안내',
  806. content: '준비중입니다.',
  807. yes: {
  808. text: '확인',
  809. isProc: false
  810. }
  811. });
  812. };
  813. // 아이디 찾기 모달 관련 함수들
  814. const openFindIdModal = () => {
  815. // URL 파라미터에서 type을 가져와서 회원 유형 설정
  816. const typeParam = route.query.type;
  817. if (typeParam && ['influence', 'vendor', 'brand'].includes(typeParam)) {
  818. findIdForm.value.memberType = typeParam;
  819. } else {
  820. findIdForm.value.memberType = loginForm.value.loginType || '';
  821. }
  822. showFindIdModal.value = true;
  823. };
  824. const closeFindIdModal = () => {
  825. showFindIdModal.value = false;
  826. resetFindIdForm();
  827. };
  828. const closeFindIdResultModal = () => {
  829. showFindIdResultModal.value = false;
  830. foundUserIds.value = [];
  831. };
  832. const resetFindIdForm = () => {
  833. // URL 파라미터에서 type을 가져와서 기본값으로 설정
  834. const typeParam = route.query.type;
  835. let defaultMemberType = '';
  836. if (typeParam && ['influence', 'vendor', 'brand'].includes(typeParam)) {
  837. defaultMemberType = typeParam;
  838. } else {
  839. defaultMemberType = loginForm.value.loginType || '';
  840. }
  841. findIdForm.value = {
  842. name: '',
  843. emailLocal: '',
  844. emailDomain: null, // 빈 문자열 대신 null로 설정
  845. memberType: defaultMemberType
  846. };
  847. findIdValidation.value = {
  848. name: true,
  849. email: true
  850. };
  851. };
  852. const validateFindIdForm = () => {
  853. let isValid = true;
  854. // 이름 검증
  855. if (!findIdForm.value.name.trim()) {
  856. findIdValidation.value.name = false;
  857. $toast.error("이름을 입력해주세요.");
  858. isValid = false;
  859. } else {
  860. findIdValidation.value.name = true;
  861. }
  862. // 이메일 검증
  863. if (!findIdForm.value.emailLocal.trim() || !findIdForm.value.emailDomain) {
  864. findIdValidation.value.email = false;
  865. $toast.error("이메일을 입력해주세요.");
  866. isValid = false;
  867. } else {
  868. findIdValidation.value.email = true;
  869. }
  870. // 회원 타입 검증
  871. if (!findIdForm.value.memberType) {
  872. $toast.error("회원 유형을 선택해주세요.");
  873. isValid = false;
  874. }
  875. return isValid;
  876. };
  877. const findUserId = async () => {
  878. if (!validateFindIdForm()) {
  879. return;
  880. }
  881. findIdLoading.value = true;
  882. try {
  883. const fullEmail = `${findIdForm.value.emailLocal}@${findIdForm.value.emailDomain}`;
  884. const response = await useAxios().post('/auth/findId', {
  885. name: findIdForm.value.name.trim(),
  886. email: fullEmail,
  887. memberType: findIdForm.value.memberType
  888. });
  889. if (response.data && response.data.userIds) {
  890. foundUserIds.value = response.data.userIds;
  891. } else {
  892. foundUserIds.value = [];
  893. }
  894. closeFindIdModal();
  895. showFindIdResultModal.value = true;
  896. } catch (error) {
  897. console.error('Find ID error:', error);
  898. if (error.response?.status === 404) {
  899. foundUserIds.value = [];
  900. closeFindIdModal();
  901. showFindIdResultModal.value = true;
  902. } else {
  903. $toast.error('아이디 찾기 중 오류가 발생했습니다.');
  904. }
  905. } finally {
  906. findIdLoading.value = false;
  907. }
  908. };
  909. const maskUserId = (userId) => {
  910. if (!userId || userId.length < 3) {
  911. return userId;
  912. }
  913. if (userId.length <= 6) {
  914. return userId.substring(0, 3) + '*'.repeat(userId.length - 3);
  915. } else {
  916. return userId.substring(0, 3) + '*'.repeat(4) + userId.substring(userId.length - 2);
  917. }
  918. };
  919. const getMemberTypeText = (type) => {
  920. const typeMap = {
  921. 'influence': '인플루언서',
  922. 'vendor': '벤더사',
  923. 'brand': '브랜드사'
  924. };
  925. return typeMap[type] || type;
  926. };
  927. const formatDate = (dateString) => {
  928. if (!dateString) return '';
  929. const date = new Date(dateString);
  930. return date.getFullYear() + '.' +
  931. String(date.getMonth() + 1).padStart(2, '0') + '.' +
  932. String(date.getDate()).padStart(2, '0');
  933. };
  934. const goToLoginFromModal = () => {
  935. closeFindIdResultModal();
  936. // 필요시 특정 아이디를 로그인 폼에 미리 채울 수 있음
  937. };
  938. // 비밀번호 찾기 모달 관련 함수들
  939. const openFindPwModal = () => {
  940. // URL 파라미터에서 type을 가져와서 회원 유형 설정
  941. const typeParam = route.query.type;
  942. if (typeParam && ['influence', 'vendor', 'brand'].includes(typeParam)) {
  943. findPwForm.value.memberType = typeParam;
  944. } else {
  945. findPwForm.value.memberType = loginForm.value.loginType || '';
  946. }
  947. showFindPwModal.value = true;
  948. };
  949. const closeFindPwModal = () => {
  950. showFindPwModal.value = false;
  951. resetFindPwForm();
  952. };
  953. const closeChangePwModal = () => {
  954. showChangePwModal.value = false;
  955. resetChangePwForm();
  956. foundUser.value = null;
  957. };
  958. const resetFindPwForm = () => {
  959. // URL 파라미터에서 type을 가져와서 기본값으로 설정
  960. const typeParam = route.query.type;
  961. let defaultMemberType = '';
  962. if (typeParam && ['influence', 'vendor', 'brand'].includes(typeParam)) {
  963. defaultMemberType = typeParam;
  964. } else {
  965. defaultMemberType = loginForm.value.loginType || '';
  966. }
  967. findPwForm.value = {
  968. name: '',
  969. userId: '',
  970. emailLocal: '',
  971. emailDomain: null, // 빈 문자열 대신 null로 설정
  972. memberType: defaultMemberType
  973. };
  974. findPwValidation.value = {
  975. name: true,
  976. userId: true,
  977. email: true
  978. };
  979. };
  980. const resetChangePwForm = () => {
  981. changePwForm.value = {
  982. newPassword: '',
  983. confirmPassword: ''
  984. };
  985. changePwValidation.value = {
  986. newPassword: true,
  987. confirmPassword: true
  988. };
  989. showNewPassword.value = false;
  990. showConfirmPassword.value = false;
  991. };
  992. const validateFindPwForm = () => {
  993. let isValid = true;
  994. // 이름 검증
  995. if (!findPwForm.value.name.trim()) {
  996. findPwValidation.value.name = false;
  997. $toast.error("이름을 입력해주세요.");
  998. isValid = false;
  999. } else {
  1000. findPwValidation.value.name = true;
  1001. }
  1002. // 아이디 검증
  1003. if (!findPwForm.value.userId.trim()) {
  1004. findPwValidation.value.userId = false;
  1005. $toast.error("아이디를 입력해주세요.");
  1006. isValid = false;
  1007. } else {
  1008. findPwValidation.value.userId = true;
  1009. }
  1010. // 이메일 검증
  1011. if (!findPwForm.value.emailLocal.trim() || !findPwForm.value.emailDomain) {
  1012. findPwValidation.value.email = false;
  1013. $toast.error("이메일을 입력해주세요.");
  1014. isValid = false;
  1015. } else {
  1016. findPwValidation.value.email = true;
  1017. }
  1018. return isValid;
  1019. };
  1020. const validateChangePwForm = () => {
  1021. let isValid = true;
  1022. // 새 비밀번호 검증
  1023. if (!changePwForm.value.newPassword.trim()) {
  1024. changePwValidation.value.newPassword = false;
  1025. $toast.error("새 비밀번호를 입력해주세요.");
  1026. isValid = false;
  1027. } else if (changePwForm.value.newPassword.length < 6) {
  1028. changePwValidation.value.newPassword = false;
  1029. $toast.error("비밀번호는 최소 6자 이상 입력해주세요.");
  1030. isValid = false;
  1031. } else {
  1032. changePwValidation.value.newPassword = true;
  1033. }
  1034. // 비밀번호 확인 검증
  1035. if (!changePwForm.value.confirmPassword.trim()) {
  1036. changePwValidation.value.confirmPassword = false;
  1037. $toast.error("비밀번호 확인을 입력해주세요.");
  1038. isValid = false;
  1039. } else if (changePwForm.value.newPassword !== changePwForm.value.confirmPassword) {
  1040. changePwValidation.value.confirmPassword = false;
  1041. $toast.error("비밀번호가 일치하지 않습니다.");
  1042. isValid = false;
  1043. } else {
  1044. changePwValidation.value.confirmPassword = true;
  1045. }
  1046. return isValid;
  1047. };
  1048. const findUserPw = async () => {
  1049. if (!validateFindPwForm()) {
  1050. return;
  1051. }
  1052. findPwLoading.value = true;
  1053. try {
  1054. const fullEmail = `${findPwForm.value.emailLocal}@${findPwForm.value.emailDomain}`;
  1055. const response = await useAxios().post('/auth/findPw', {
  1056. name: findPwForm.value.name.trim(),
  1057. userId: findPwForm.value.userId.trim(),
  1058. email: fullEmail,
  1059. memberType: findPwForm.value.memberType,
  1060. step: 'verify' // 첫 번째 단계: 사용자 확인
  1061. });
  1062. if (response.data && response.data.user) {
  1063. foundUser.value = response.data.user;
  1064. closeFindPwModal();
  1065. showChangePwModal.value = true;
  1066. } else {
  1067. $toast.error('입력하신 정보와 일치하는 사용자가 없습니다.');
  1068. }
  1069. } catch (error) {
  1070. console.error('Find password error:', error);
  1071. if (error.response?.status === 404) {
  1072. $toast.error('입력하신 정보와 일치하는 사용자가 없습니다.');
  1073. } else {
  1074. $toast.error('비밀번호 찾기 중 오류가 발생했습니다.');
  1075. }
  1076. } finally {
  1077. findPwLoading.value = false;
  1078. }
  1079. };
  1080. const changePassword = async () => {
  1081. if (!validateChangePwForm() || !foundUser.value) {
  1082. return;
  1083. }
  1084. changePwLoading.value = true;
  1085. try {
  1086. const response = await useAxios().post('/auth/findPw', {
  1087. userId: foundUser.value.userId,
  1088. memberType: foundUser.value.memberType,
  1089. newPassword: changePwForm.value.newPassword,
  1090. step: 'change' // 두 번째 단계: 비밀번호 변경
  1091. });
  1092. if (response.data && response.data.status === 'success') {
  1093. $toast.success('비밀번호가 성공적으로 변경되었습니다.');
  1094. closeChangePwModal();
  1095. } else {
  1096. $toast.error('비밀번호 변경에 실패했습니다.');
  1097. }
  1098. } catch (error) {
  1099. console.error('Change password error:', error);
  1100. $toast.error('비밀번호 변경 중 오류가 발생했습니다.');
  1101. } finally {
  1102. changePwLoading.value = false;
  1103. }
  1104. };
  1105. const fnLoginSet = (__MSG) => {
  1106. let param = {
  1107. id: pageId,
  1108. title: "로그인",
  1109. content: __MSG,
  1110. yes: {
  1111. text: "확인",
  1112. isProc: true,
  1113. event: "FN_LOGIN",
  1114. param: "",
  1115. },
  1116. };
  1117. $eventBus.emit("OPEN_CONFIRM_POP_UP", param);
  1118. };
  1119. // 구글 로그인 인증 시퀀스
  1120. function onGoogleLogin() {
  1121. const appBaseUrl = import.meta.env.VITE_APP_API_URL;
  1122. const clientId =
  1123. "373780605211-diojebh7mug45urv9rnqdil6n0b1ogge.apps.googleusercontent.com"; // 실제 클라이언트 ID로 교체
  1124. //const redirectUri = "https://shopdeli.mycafe24.com/auth/callback"; // 실제 리디렉션 URI로 교체
  1125. const redirectUri = `${appBaseUrl}/auth/callback`;
  1126. const scope = "openid email profile";
  1127. const responseType = "code"; // 또는 'code' (백엔드 연동 시)
  1128. const state = Math.random().toString(36).substring(2);
  1129. const googleAuthUrl = `https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&client_id=${clientId}&redirect_uri=${encodeURIComponent(
  1130. redirectUri
  1131. )}&response_type=${responseType}&scope=${encodeURIComponent(scope)}&state=${state}`;
  1132. const width = 500;
  1133. const height = 600;
  1134. const dualScreenLeft =
  1135. window.screenLeft !== undefined ? window.screenLeft : window.screenX;
  1136. const dualScreenTop =
  1137. window.screenTop !== undefined ? window.screenTop : window.screenY;
  1138. const currentWidth = window.innerWidth
  1139. ? window.innerWidth
  1140. : document.documentElement.clientWidth
  1141. ? document.documentElement.clientWidth
  1142. : screen.width;
  1143. const currentHeight = window.innerHeight
  1144. ? window.innerHeight
  1145. : document.documentElement.clientHeight
  1146. ? document.documentElement.clientHeight
  1147. : screen.height;
  1148. const left = dualScreenLeft + (currentWidth - width) / 2;
  1149. const top = dualScreenTop + (currentHeight - height) / 2;
  1150. window.open(
  1151. googleAuthUrl,
  1152. "googleLogin",
  1153. `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=yes`
  1154. );
  1155. }
  1156. //카카오 인증 시퀀스
  1157. function onKakaoLogin() {
  1158. const appBaseUrl = import.meta.env.VITE_APP_API_URL;
  1159. const kakaoAuthUrl = `${appBaseUrl}/auth/kakaoLogin`; // 실제 리디렉션 URI로 교체
  1160. const width = 500;
  1161. const height = 600;
  1162. const dualScreenLeft =
  1163. window.screenLeft !== undefined ? window.screenLeft : window.screenX;
  1164. const dualScreenTop =
  1165. window.screenTop !== undefined ? window.screenTop : window.screenY;
  1166. const currentWidth = window.innerWidth
  1167. ? window.innerWidth
  1168. : document.documentElement.clientWidth
  1169. ? document.documentElement.clientWidth
  1170. : screen.width;
  1171. const currentHeight = window.innerHeight
  1172. ? window.innerHeight
  1173. : document.documentElement.clientHeight
  1174. ? document.documentElement.clientHeight
  1175. : screen.height;
  1176. const left = dualScreenLeft + (currentWidth - width) / 2;
  1177. const top = dualScreenTop + (currentHeight - height) / 2;
  1178. window.open(
  1179. kakaoAuthUrl,
  1180. "kakaoLogin",
  1181. `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=yes`
  1182. );
  1183. }
  1184. //네이버 인증 시퀀스
  1185. function onNaverLogin() {
  1186. const appBaseUrl = import.meta.env.VITE_APP_API_URL;
  1187. const naverAuthUrl = `${appBaseUrl}/auth/naverLogin`; // 실제 리디렉션 URI로 교체
  1188. const width = 500;
  1189. const height = 600;
  1190. const dualScreenLeft =
  1191. window.screenLeft !== undefined ? window.screenLeft : window.screenX;
  1192. const dualScreenTop =
  1193. window.screenTop !== undefined ? window.screenTop : window.screenY;
  1194. const currentWidth = window.innerWidth
  1195. ? window.innerWidth
  1196. : document.documentElement.clientWidth
  1197. ? document.documentElement.clientWidth
  1198. : screen.width;
  1199. const currentHeight = window.innerHeight
  1200. ? window.innerHeight
  1201. : document.documentElement.clientHeight
  1202. ? document.documentElement.clientHeight
  1203. : screen.height;
  1204. const left = dualScreenLeft + (currentWidth - width) / 2;
  1205. const top = dualScreenTop + (currentHeight - height) / 2;
  1206. window.open(
  1207. naverAuthUrl,
  1208. "naverLogin",
  1209. `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=yes`
  1210. );
  1211. }
  1212. /**
  1213. * @API
  1214. * 최종 로그인 버튼 클릭 시 API
  1215. */
  1216. function fnLogin(__USERID, __USERPASS) {
  1217. // 파라미터 전달 값 [아이디, 비밀번호, otpNum, 브라우저정보]
  1218. //userId: loginForm.value.userId,
  1219. // let _req = {
  1220. // username: loginForm.value.userId,
  1221. // password: btoa(loginForm.value.passwd),
  1222. // };
  1223. localStorage.setItem("tempAccess", __USERID);
  1224. if (__USERID == "admin" && __USERPASS == "1234") {
  1225. useUtil.setPageMove("/view/media/newsList");
  1226. } else {
  1227. fnLoginSet("비밀번호가 맞지 않습니다. 확인해주세요.");
  1228. }
  1229. // useAxios()
  1230. // .post(apiUrl.otpCheck, _req)
  1231. // .then((res) => {
  1232. // loginInfo.value = res.data.data;
  1233. // useAuthStore().setAccessToken(loginInfo.value.accessToken);
  1234. // useAuthStore().setRefreshToken(loginInfo.value.refreshToken);
  1235. // // OTP key체크 성공 후 개인정보에 대한 API를 호출 한다.
  1236. // fnServiceModeCheck();
  1237. // $log.debug("[login][fnLogin][success]");
  1238. // })
  1239. // .catch((error) => {
  1240. // $log.debug("[login][fnLogin][error]");
  1241. // let errorData = error.response.data;
  1242. // errorData.type = "fnLogin";
  1243. // fnLoginFail(errorData);
  1244. // })
  1245. // .finally(() => {
  1246. // $log.debug("[login][fnLogin][finished]");
  1247. // });
  1248. }
  1249. /**
  1250. * @SCRIPT
  1251. * 비밀번호확인 validation
  1252. */
  1253. function fnValidCheck(type) {
  1254. // 아이디 체크
  1255. if (type === "id") {
  1256. const id = loginForm.value.userId;
  1257. // 1. 기본 유효성 검사
  1258. if (!id) {
  1259. $toast.error("아이디를 입력해주세요.");
  1260. return false;
  1261. }
  1262. // 2. 아이디 형식 검사 (영문, 숫자 조합 6~20자)
  1263. const idRegex = /^[a-zA-Z0-9]{6,20}$/;
  1264. if (!idRegex.test(id)) {
  1265. $toast.error("아이디는 영문, 숫자 조합 6~20자로 입력해주세요.");
  1266. return false;
  1267. }
  1268. }
  1269. // 다른 유효성 검사가 필요한 경우 여기에 추가
  1270. return true;
  1271. }
  1272. </script>
  1273. <style scoped>
  1274. /* 게이트 컨테이너 */
  1275. .gate-container {
  1276. width: 100%;
  1277. display: flex;
  1278. justify-content: center;
  1279. align-items: center;
  1280. gap: 1rem;
  1281. min-height: 100vh;
  1282. padding: 2rem;
  1283. }
  1284. /* 게이트 카드 */
  1285. .gate-card {
  1286. background: white;
  1287. border-radius: 20px;
  1288. padding: 2.5rem 2rem;
  1289. text-align: center;
  1290. box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  1291. transition: all 0.3s ease;
  1292. cursor: pointer;
  1293. position: relative;
  1294. overflow: hidden;
  1295. width: 18rem;
  1296. min-height: 320px;
  1297. display: flex;
  1298. flex-direction: column;
  1299. justify-content: center;
  1300. }
  1301. .gate-card:hover {
  1302. transform: translateY(-10px);
  1303. box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  1304. }
  1305. .gate-card.actv {
  1306. transform: translateY(-15px) scale(1.05);
  1307. box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
  1308. }
  1309. /* 게이트 아이콘 */
  1310. .gate-icon {
  1311. margin-bottom: 1.5rem;
  1312. }
  1313. .icon-circle {
  1314. width: 80px;
  1315. height: 80px;
  1316. border-radius: 50%;
  1317. display: flex;
  1318. align-items: center;
  1319. justify-content: center;
  1320. font-size: 2.5rem;
  1321. margin: 0 auto;
  1322. transition: all 0.3s ease;
  1323. }
  1324. .influencer-bg {
  1325. background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
  1326. }
  1327. .vendor-bg {
  1328. background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  1329. }
  1330. .brand-bg {
  1331. background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%);
  1332. }
  1333. .gate-card:hover .icon-circle {
  1334. transform: scale(1.1);
  1335. }
  1336. /* 게이트 콘텐츠 */
  1337. .gate-content h3 {
  1338. font-size: 1.5rem;
  1339. font-weight: 700;
  1340. color: #333;
  1341. margin-bottom: 0.5rem;
  1342. }
  1343. .gate-content p {
  1344. color: #666;
  1345. font-size: 1rem;
  1346. margin-bottom: 2rem;
  1347. line-height: 1.5;
  1348. }
  1349. /* 게이트 버튼 */
  1350. .gate-btn {
  1351. border-radius: 25px !important;
  1352. padding: 12px 30px !important;
  1353. font-weight: 600 !important;
  1354. text-transform: none !important;
  1355. transition: all 0.3s ease !important;
  1356. border: none !important;
  1357. box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
  1358. }
  1359. .influencer-btn {
  1360. background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%) !important;
  1361. color: white !important;
  1362. }
  1363. .vendor-btn {
  1364. background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%) !important;
  1365. color: white !important;
  1366. }
  1367. .brand-btn {
  1368. background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%) !important;
  1369. color: white !important;
  1370. }
  1371. .gate-btn:hover {
  1372. transform: translateY(-2px) !important;
  1373. box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
  1374. }
  1375. /* 반응형 디자인 */
  1376. @media (max-width: 768px) {
  1377. .gate-container {
  1378. flex-direction: column;
  1379. gap: 1.5rem;
  1380. padding: 1rem;
  1381. }
  1382. .gate-card {
  1383. width: 100%;
  1384. max-width: 300px;
  1385. min-height: 280px;
  1386. padding: 2rem 1.5rem;
  1387. }
  1388. .icon-circle {
  1389. width: 60px;
  1390. height: 60px;
  1391. font-size: 2rem;
  1392. }
  1393. .gate-content h3 {
  1394. font-size: 1.3rem;
  1395. }
  1396. .gate-content p {
  1397. font-size: 0.9rem;
  1398. margin-bottom: 1.5rem;
  1399. }
  1400. }
  1401. /* 기존 스타일과 충돌 방지 */
  1402. .login--gate {
  1403. position: relative;
  1404. z-index: 1;
  1405. }
  1406. /* 아이디 찾기 모달 스타일 - 고객센터 모달과 동일하게 */
  1407. .email-input-group {
  1408. display: flex;
  1409. align-items: center;
  1410. gap: 8px;
  1411. }
  1412. .email-local {
  1413. flex: 2;
  1414. }
  1415. .email-at {
  1416. color: #333;
  1417. font-weight: 500;
  1418. margin: 0 4px;
  1419. font-size: 16px;
  1420. }
  1421. .email-domain {
  1422. flex: 2;
  1423. }
  1424. /* 결과 모달 스타일 */
  1425. .result-success .success-icon,
  1426. .result-error .error-icon {
  1427. font-size: 48px;
  1428. margin-bottom: 16px;
  1429. }
  1430. .result-success h4,
  1431. .result-error h4 {
  1432. margin: 0 0 16px 0;
  1433. color: #333;
  1434. font-size: 1.3rem;
  1435. font-weight: 600;
  1436. }
  1437. .result-error p {
  1438. color: #666;
  1439. line-height: 1.5;
  1440. margin: 0;
  1441. }
  1442. .found-ids {
  1443. margin-top: 20px;
  1444. text-align: left;
  1445. }
  1446. .user-info {
  1447. background: #f8f9fa;
  1448. border-radius: 8px;
  1449. padding: 16px;
  1450. margin-bottom: 12px;
  1451. border: 1px solid #e9ecef;
  1452. }
  1453. .user-info:last-child {
  1454. margin-bottom: 0;
  1455. }
  1456. .user-type {
  1457. color: #666;
  1458. font-size: 12px;
  1459. margin: 0 0 6px 0;
  1460. font-weight: 500;
  1461. text-transform: uppercase;
  1462. }
  1463. .user-id {
  1464. font-size: 18px;
  1465. font-weight: bold;
  1466. color: #333;
  1467. margin: 0 0 6px 0;
  1468. letter-spacing: 1px;
  1469. font-family: 'Courier New', monospace;
  1470. }
  1471. .join-date {
  1472. color: #999;
  1473. font-size: 13px;
  1474. margin: 0;
  1475. }
  1476. /* 반응형 */
  1477. @media (max-width: 768px) {
  1478. .email-input-group {
  1479. flex-direction: column;
  1480. align-items: stretch;
  1481. gap: 12px;
  1482. }
  1483. .email-at {
  1484. text-align: center;
  1485. margin: 0;
  1486. }
  1487. .email-local,
  1488. .email-domain {
  1489. flex: 1;
  1490. }
  1491. }
  1492. /* 비밀번호 변경 모달 스타일 */
  1493. .success-message {
  1494. text-align: center;
  1495. background: #f0f9f4;
  1496. padding: 20px;
  1497. border-radius: 8px;
  1498. border: 1px solid #d1fae5;
  1499. }
  1500. .success-message .success-icon {
  1501. font-size: 32px;
  1502. margin-bottom: 8px;
  1503. }
  1504. .success-message p {
  1505. color: #065f46;
  1506. line-height: 1.5;
  1507. margin: 0;
  1508. }
  1509. </style>