Refactor client (#3178)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip
This commit is contained in:
syuilo 2018-11-09 16:00:29 +09:00 committed by GitHub
parent 5d882dc3df
commit 3f79c9ae49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 328 additions and 421 deletions

View file

@ -35,7 +35,7 @@ export default Vue.extend({
},
methods: {
register() {
this.$root.apis.input({
this.$input({
title: this.$t('enter-password'),
type: 'password'
}).then(password => {
@ -48,14 +48,14 @@ export default Vue.extend({
},
unregister() {
this.$root.apis.input({
this.$input({
title: this.$t('enter-password'),
type: 'password'
}).then(password => {
this.$root.api('i/2fa/unregister', {
password: password
}).then(() => {
this.$root.apis.notify(this.$t('unregistered'));
this.$notify(this.$t('unregistered'));
this.$store.state.i.twoFactorEnabled = false;
});
});
@ -65,10 +65,10 @@ export default Vue.extend({
this.$root.api('i/2fa/done', {
token: this.token
}).then(() => {
this.$root.apis.notify(this.$t('success'));
this.$notify(this.$t('success'));
this.$store.state.i.twoFactorEnabled = true;
}).catch(() => {
this.$root.apis.notify(this.$t('failed'));
this.$notify(this.$t('failed'));
});
}
}