1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-12-16 07:38:07 +09:00
hotomoe/packages/client/src/pages/reset-password.vue

67 lines
1.3 KiB
Vue
Raw Normal View History

<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>
<template #label>{{ $ts.newPassword }}</template>
</FormInput>
<FormButton primary class="_formBlock" @click="save">{{ $ts.save }}</FormButton>
</div>
</MkSpacer>
</template>
<script lang="ts">
import { defineComponent } 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';
export default defineComponent({
components: {
FormInput,
FormButton,
},
props: {
token: {
type: String,
required: false
}
},
data() {
return {
[symbols.PAGE_INFO]: {
title: this.$ts.resetPassword,
2022-01-02 21:35:23 +09:00
icon: 'fas fa-lock',
bg: 'var(--bg)',
},
password: '',
}
},
mounted() {
if (this.token == null) {
2021-11-12 02:02:25 +09:00
os.popup(import('@/components/forgot-password.vue'), {}, {}, 'closed');
this.$router.push('/');
}
},
methods: {
async save() {
await os.apiWithDialog('reset-password', {
token: this.token,
password: this.password,
});
this.$router.push('/');
}
}
});
</script>
<style lang="scss" scoped>
</style>