2021-05-03 23:05:34 -07:00
|
|
|
<template>
|
2022-01-02 04:35:23 -08: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>
|
2021-05-03 23:05:34 -07:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent } from 'vue';
|
2022-01-02 04:35:23 -08:00
|
|
|
import FormInput from '@/components/form/input.vue';
|
|
|
|
import FormButton from '@/components/ui/button.vue';
|
2021-11-11 09:02:25 -08:00
|
|
|
import * as os from '@/os';
|
|
|
|
import * as symbols from '@/symbols';
|
2021-05-03 23:05:34 -07:00
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
|
|
|
FormInput,
|
|
|
|
FormButton,
|
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
|
|
|
token: {
|
|
|
|
type: String,
|
|
|
|
required: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
[symbols.PAGE_INFO]: {
|
|
|
|
title: this.$ts.resetPassword,
|
2022-01-02 04:35:23 -08:00
|
|
|
icon: 'fas fa-lock',
|
|
|
|
bg: 'var(--bg)',
|
2021-05-03 23:05:34 -07:00
|
|
|
},
|
|
|
|
password: '',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
if (this.token == null) {
|
2021-11-11 09:02:25 -08:00
|
|
|
os.popup(import('@/components/forgot-password.vue'), {}, {}, 'closed');
|
2021-05-03 23:05:34 -07:00
|
|
|
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>
|