2018-02-21 08:25:57 -08:00
|
|
|
<template>
|
|
|
|
<div>
|
2018-04-14 09:04:40 -07:00
|
|
|
<button @click="reset" class="ui primary">%i18n:@reset%</button>
|
2018-02-21 08:25:57 -08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
methods: {
|
|
|
|
reset() {
|
|
|
|
(this as any).apis.input({
|
2018-04-14 09:04:40 -07:00
|
|
|
title: '%i18n:@enter-current-password%',
|
2018-02-21 08:25:57 -08:00
|
|
|
type: 'password'
|
|
|
|
}).then(currentPassword => {
|
|
|
|
(this as any).apis.input({
|
2018-04-14 09:04:40 -07:00
|
|
|
title: '%i18n:@enter-new-password%',
|
2018-02-21 08:25:57 -08:00
|
|
|
type: 'password'
|
|
|
|
}).then(newPassword => {
|
|
|
|
(this as any).apis.input({
|
2018-04-14 09:04:40 -07:00
|
|
|
title: '%i18n:@enter-new-password-again%',
|
2018-02-21 08:25:57 -08:00
|
|
|
type: 'password'
|
|
|
|
}).then(newPassword2 => {
|
|
|
|
if (newPassword !== newPassword2) {
|
|
|
|
(this as any).apis.dialog({
|
|
|
|
title: null,
|
2018-04-14 09:04:40 -07:00
|
|
|
text: '%i18n:@not-match%',
|
2018-02-21 08:25:57 -08:00
|
|
|
actions: [{
|
|
|
|
text: 'OK'
|
|
|
|
}]
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
(this as any).api('i/change_password', {
|
2018-03-28 22:48:47 -07:00
|
|
|
currentPasword: currentPassword,
|
|
|
|
newPassword: newPassword
|
2018-02-21 08:25:57 -08:00
|
|
|
}).then(() => {
|
2018-04-14 09:04:40 -07:00
|
|
|
(this as any).apis.notify('%i18n:@changed%');
|
2018-02-21 08:25:57 -08:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|