first
This commit is contained in:
153
inspond-nuxt-safekiso/base/pages/user/reset-password.vue
Normal file
153
inspond-nuxt-safekiso/base/pages/user/reset-password.vue
Normal file
@@ -0,0 +1,153 @@
|
||||
<!--
|
||||
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="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="doReset">
|
||||
<input type="hidden" name="remember" value="true" />
|
||||
<div class="rounded-md shadow-sm -space-y-px">
|
||||
<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 route = useRoute();
|
||||
console.log('huk query = ', route.query);
|
||||
|
||||
const hero = ref(route.query.key);
|
||||
const password = ref('');
|
||||
const password2 = ref('');
|
||||
|
||||
async function doReset() {
|
||||
if (password.value != password2.value) {
|
||||
alert('비밀번호가 일치하지 않습니다.');
|
||||
return;
|
||||
}
|
||||
|
||||
const responseJson = await _crossCtl.doComm('update', 'password:reset', {
|
||||
hero: hero.value,
|
||||
passwordNew: password.value,
|
||||
passwordAgain: password.value,
|
||||
});
|
||||
|
||||
_utils.log('debug', 'responseJson=', responseJson);
|
||||
|
||||
switch (responseJson['responseMessage']) {
|
||||
case 'Expired reset request':
|
||||
alert('이미 사용된 비밀번호 리셋 링크입니다.');
|
||||
break;
|
||||
case 'ok':
|
||||
alert('새로운 비밀번호가 설정되었습니다.');
|
||||
break;
|
||||
default:
|
||||
alert(responseJson['responseMessage']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user