193 lines
6.9 KiB
Vue
193 lines
6.9 KiB
Vue
<!--
|
|
This example requires Tailwind CSS v2.0+
|
|
|
|
This example requires some changes to your config:
|
|
|
|
```
|
|
// tailwind.config.js
|
|
module.exports = {
|
|
// ...
|
|
plugins: [
|
|
// ...
|
|
require('@tailwindcss/forms'),
|
|
],
|
|
}
|
|
```
|
|
-->
|
|
<template>
|
|
<!--
|
|
This example requires updating your template:
|
|
|
|
```
|
|
<html class="h-full bg-gray-50">
|
|
<body class="h-full">
|
|
```
|
|
-->
|
|
<div
|
|
class="bg-white min-h-full flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8"
|
|
>
|
|
<div class="max-w-md w-full space-y-8">
|
|
<div>
|
|
<h2
|
|
class="mt-6 text-center text-3xl font-extrabold text-gray-900"
|
|
>
|
|
계정등록
|
|
</h2>
|
|
<p class="mt-2 text-center text-sm text-gray-600">
|
|
계정이 있는 경우
|
|
{{ ' ' }}
|
|
<a
|
|
href="javascript:void()"
|
|
class="font-medium text-indigo-600 hover:text-indigo-500"
|
|
@click="navigateTo('/user/signin')"
|
|
>
|
|
이곳에서 로그인
|
|
</a>
|
|
</p>
|
|
</div>
|
|
<form class="mt-8 space-y-6" @submit.prevent="signup">
|
|
<input type="hidden" name="remember" value="true" />
|
|
<div class="rounded-md shadow-sm -space-y-px">
|
|
<div>
|
|
<label for="email-address" class="sr-only"
|
|
>이메일 주소</label
|
|
>
|
|
<input
|
|
id="email-address"
|
|
v-model="email"
|
|
name="email"
|
|
type="email"
|
|
autocomplete="email"
|
|
required=""
|
|
class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm"
|
|
placeholder="이메일 주소"
|
|
/>
|
|
</div>
|
|
<div>
|
|
<label for="password" class="sr-only"
|
|
>로그인 비밀번호</label
|
|
>
|
|
<input
|
|
id="password"
|
|
v-model="password"
|
|
name="password"
|
|
type="password"
|
|
autocomplete="current-password"
|
|
required=""
|
|
class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm"
|
|
placeholder="비밀번호"
|
|
/>
|
|
</div>
|
|
<div>
|
|
<label for="password2" class="sr-only"
|
|
>비밀번호 확인</label
|
|
>
|
|
<input
|
|
id="password2"
|
|
v-model="password2"
|
|
name="password2"
|
|
type="password"
|
|
autocomplete="current-password2"
|
|
required=""
|
|
class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm"
|
|
placeholder="비밀번호 확인"
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<button
|
|
type="submit"
|
|
class="group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
|
|
>
|
|
<span
|
|
class="absolute left-0 inset-y-0 flex items-center pl-3"
|
|
>
|
|
<LockClosedIcon
|
|
class="h-5 w-5 text-indigo-500 group-hover:text-indigo-400"
|
|
aria-hidden="true"
|
|
/>
|
|
</span>
|
|
계정등록
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { LockClosedIcon } from '@heroicons/vue/24/solid/index.js';
|
|
|
|
definePageMeta({
|
|
layout: 'center',
|
|
});
|
|
|
|
useHead({
|
|
htmlAttrs: {
|
|
class: 'h-full bg-white',
|
|
},
|
|
bodyAttrs: {
|
|
class: 'h-full',
|
|
},
|
|
});
|
|
|
|
const email = ref('');
|
|
const password = ref('');
|
|
const password2 = ref('');
|
|
|
|
async function signup() {
|
|
if (password.value != password2.value) {
|
|
alert('비밀번호가 일치하지 않습니다.');
|
|
return;
|
|
}
|
|
|
|
const responseJson = await _crossCtl.doComm('signup', '', {
|
|
userName: email.value,
|
|
password: password.value,
|
|
});
|
|
|
|
_utils.log('debug', 'responseJson=', responseJson);
|
|
|
|
switch (responseJson['responseMessage']) {
|
|
case 'not in a white list':
|
|
alert(
|
|
'사전 승인이 필요합니다. 확인을 누르시면 안내 페이지로 이동합니다.'
|
|
);
|
|
navigateTo('/doc/contract');
|
|
break;
|
|
case 'ok':
|
|
alert('가입 완료. 확인을 누르시면 로그인 화면으로 이동합니다.');
|
|
navigateTo('/user/signin');
|
|
break;
|
|
default:
|
|
alert(responseJson['responseMessage']);
|
|
break;
|
|
}
|
|
}
|
|
console.log(
|
|
'huk _crossCtl.isSignUpInfoNoticed = ',
|
|
_crossCtl.isSignUpInfoNoticed
|
|
);
|
|
if (_crossCtl.isSignUpInfoNoticed == false) {
|
|
_crossCtl.isSignUpInfoNoticed = true;
|
|
console.log('open modal');
|
|
|
|
_crossCtl.openModal(
|
|
'info',
|
|
'계정등록 안내',
|
|
'본 서비스의 회원 가입은 정식 계약 신청 후 서버에 등록된 이메일에 대해서만 가능합니다.' +
|
|
"만약 정식 서비스 계약을 체결하지 않으셨다면 먼저 '서비스 이용 절차' 부분의 내용을 참고해 주시기 바랍니다.",
|
|
['확인', '서비스 이용 절차 확인'],
|
|
(serial, btnIdx) => {
|
|
console.log('btnIdx=', btnIdx);
|
|
|
|
if (btnIdx == 1) {
|
|
// navigateTo('/#service_use_agreement');
|
|
window.location.href = '/#service-use-agreement';
|
|
}
|
|
}
|
|
);
|
|
}
|
|
</script>
|