From 889b52e813600a1fb9720ed053d9c61967be3005 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 11 Jan 2021 20:57:48 +0900 Subject: アカウントの閉鎖をクライアントから行えるように MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/pages/settings/other.vue | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src') diff --git a/src/client/pages/settings/other.vue b/src/client/pages/settings/other.vue index bc42b747d5..426d91ba01 100644 --- a/src/client/pages/settings/other.vue +++ b/src/client/pages/settings/other.vue @@ -20,6 +20,8 @@ {{ $ts.registry }} + + {{ $ts.closeAccount }} @@ -35,6 +37,7 @@ import FormButton from '@/components/form/button.vue'; import * as os from '@/os'; import { debug } from '@/config'; import { defaultStore } from '@/store'; +import { signout } from '@/account'; export default defineComponent({ components: { @@ -83,6 +86,22 @@ export default defineComponent({ taskmanager() { os.popup(import('@/components/taskmanager.vue'), { }, {}, 'closed'); + }, + + closeAccount() { + os.dialog({ + title: this.$ts.password, + input: { + type: 'password' + } + }).then(({ canceled, result: password }) => { + if (canceled) return; + os.api('i/delete-account', { + password: password + }).then(() => { + signout(); + }); + }); } } }); -- cgit v1.3.1-freya