2021-05-04 15:05:34 +09:00
|
|
|
<template>
|
2022-01-02 21:35:23 +09:00
|
|
|
<MkSpacer v-if="token" :content-max="700" :margin-min="16" :margin-max="32">
|
|
|
|
<div class="_formRoot">
|
|
|
|
<FormInput v-model="password" type="password" class="_formBlock">
|
|
|
|
<template #prefix><i class="fas fa-lock"></i></template>
|
2022-01-16 11:02:27 +09:00
|
|
|
<template #label>{{ i18n.locale.newPassword }}</template>
|
2022-01-02 21:35:23 +09:00
|
|
|
</FormInput>
|
|
|
|
|
2022-01-16 11:02:27 +09:00
|
|
|
<FormButton primary class="_formBlock" @click="save">{{ i18n.locale.save }}</FormButton>
|
2022-01-02 21:35:23 +09:00
|
|
|
</div>
|
|
|
|
</MkSpacer>
|
2021-05-04 15:05:34 +09:00
|
|
|
</template>
|
|
|
|
|
2022-01-16 11:02:27 +09:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { onMounted } from 'vue';
|
2022-01-02 21:35:23 +09:00
|
|
|
import FormInput from '@/components/form/input.vue';
|
|
|
|
import FormButton from '@/components/ui/button.vue';
|
2021-11-12 02:02:25 +09:00
|
|
|
import * as os from '@/os';
|
|
|
|
import * as symbols from '@/symbols';
|
2022-01-16 11:02:27 +09:00
|
|
|
import { i18n } from '@/i18n';
|
|
|
|
import { router } from '@/router';
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
token?: string;
|
|
|
|
}>();
|
|
|
|
|
|
|
|
let password = $ref('');
|
|
|
|
|
|
|
|
async function save() {
|
|
|
|
await os.apiWithDialog('reset-password', {
|
|
|
|
token: props.token,
|
|
|
|
password: password,
|
|
|
|
});
|
|
|
|
router.push('/');
|
|
|
|
}
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
if (props.token == null) {
|
|
|
|
os.popup(import('@/components/forgot-password.vue'), {}, {}, 'closed');
|
|
|
|
router.push('/');
|
|
|
|
}
|
|
|
|
});
|
2021-05-04 15:05:34 +09:00
|
|
|
|
2022-01-16 11:02:27 +09:00
|
|
|
defineExpose({
|
|
|
|
[symbols.PAGE_INFO]: {
|
|
|
|
title: i18n.locale.resetPassword,
|
|
|
|
icon: 'fas fa-lock',
|
|
|
|
bg: 'var(--bg)',
|
2021-05-04 15:05:34 +09:00
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
|
|
</style>
|