diff --git a/web/html/login.html b/web/html/login.html index b6dfc299..968aa0bc 100644 --- a/web/html/login.html +++ b/web/html/login.html @@ -466,71 +466,83 @@ - + -
- - - - -
- - -

- - {{ i18n "pages.login.hello" }} - {{ i18n "pages.login.title" }} - -

-
-
- - - - - - - - - - - - - - - - - - - - - -
- -
-
-
-
-
-
-
+ +
@@ -544,7 +556,10 @@ el: '#app', data: { themeSwitcher, - loading: false, + loadingStates: { + fetched: false, + spinning: false + }, user: { username: "", password: "", @@ -559,19 +574,23 @@ }, methods: { async login() { - this.loading = true; + this.loadingStates.spinning = true; + const msg = await HttpUtil.post('/login', this.user); - this.loading = false; + if (msg.success) { location.href = basePath + 'panel/'; } + + this.loadingStates.spinning = false; }, async getTwoFactorEnable() { - this.loading = true; const msg = await HttpUtil.post('/getTwoFactorEnable'); - this.loading = false; + if (msg.success) { this.twoFactorEnable = msg.obj; + this.loadingStates.fetched = true; + return msg.obj; } }, @@ -615,4 +634,4 @@ } }); -{{ template "page/body_end" .}} +{{ template "page/body_end" .}} \ No newline at end of file