Prevent login with empty password and add refresh btn
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
.download-app
|
.download-app
|
||||||
|
a.btn.btn-sm.btn-info.btn-new-session(@click='login()', title='Refresh')
|
||||||
|
i.fa.fa-fw.fa-refresh
|
||||||
|
|
||||||
.alert.alert-danger(v-show="error")
|
.alert.alert-danger(v-show="error")
|
||||||
strong
|
strong
|
||||||
i.fa.fa-exclamation-triangle
|
i.fa.fa-exclamation-triangle
|
||||||
@@ -11,7 +14,7 @@
|
|||||||
p.text-danger(v-show='passwordWrong')
|
p.text-danger(v-show='passwordWrong')
|
||||||
strong Access denied!
|
strong Access denied!
|
||||||
|
|
|
|
||||||
button.btn.btn-primary(type="submit")
|
button.btn.btn-primary(type="submit", :disabled="!password")
|
||||||
i.fa.fa-sign-in
|
i.fa.fa-sign-in
|
||||||
| login
|
| login
|
||||||
|
|
||||||
@@ -84,6 +87,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
login() {
|
login() {
|
||||||
|
if(!this.password) return;
|
||||||
const xhr = new XMLHttpRequest();
|
const xhr = new XMLHttpRequest();
|
||||||
xhr.open('GET', '/admin/data.json');
|
xhr.open('GET', '/admin/data.json');
|
||||||
xhr.setRequestHeader("x-passwd", this.password);
|
xhr.setRequestHeader("x-passwd", this.password);
|
||||||
|
|||||||
Reference in New Issue
Block a user