[Client] Make possible to change password in mobile

モバイル版からパスワードの変更を行えるように
This commit is contained in:
syuilo
2018-11-03 21:53:03 +09:00
parent 5bebdb2511
commit 84218abf2b
5 changed files with 12 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ import Vue from 'vue';
import muteAndBlock from './mute-and-block.vue';
import error from './error.vue';
import apiSettings from './api-settings.vue';
import passwordSettings from './password-settings.vue';
import driveSettings from './drive-settings.vue';
import profileEditor from './profile-editor.vue';
import noteSkeleton from './note-skeleton.vue';
@@ -54,6 +55,7 @@ import formRadio from './ui/form/radio.vue';
Vue.component('mk-mute-and-block', muteAndBlock);
Vue.component('mk-error', error);
Vue.component('mk-api-settings', apiSettings);
Vue.component('mk-password-settings', passwordSettings);
Vue.component('mk-drive-settings', driveSettings);
Vue.component('mk-profile-editor', profileEditor);
Vue.component('mk-note-skeleton', noteSkeleton);

View File

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