1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-12-17 16:18:13 +09:00
hotomoe/src/client/app/common/views/components/password-settings.vue
syuilo 25a69ec1b6
Refactoring of i18n (#3165)
Refactoring of i18n
2018-11-09 03:44:35 +09:00

50 lines
1.1 KiB
Vue

<template>
<div>
<ui-button @click="reset">{{ $t('reset') }}</ui-button>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
import i18n from '../../../i18n';
export default Vue.extend({
i18n: i18n('common/views/components/password-settings.vue'),
methods: {
reset() {
(this as any).apis.input({
title: this.$t('enter-current-password'),
type: 'password'
}).then(currentPassword => {
(this as any).apis.input({
title: this.$t('enter-new-password'),
type: 'password'
}).then(newPassword => {
(this as any).apis.input({
title: this.$t('enter-new-password-again'),
type: 'password'
}).then(newPassword2 => {
if (newPassword !== newPassword2) {
(this as any).apis.dialog({
title: null,
text: this.$t('not-match'),
actions: [{
text: 'OK'
}]
});
return;
}
(this as any).api('i/change_password', {
currentPasword: currentPassword,
newPassword: newPassword
}).then(() => {
(this as any).apis.notify(this.$t('changed'));
});
});
});
});
}
}
});
</script>