Bug fix: Save fingerprint.
Bug fix: Show error whey device isn't plugged.
This commit is contained in:
Binary file not shown.
@@ -35,6 +35,8 @@ def enroll(sessionId, data):
|
|||||||
devices = ctx.get_devices()
|
devices = ctx.get_devices()
|
||||||
if (len(devices) == 0):
|
if (len(devices) == 0):
|
||||||
print("There is no attached device.")
|
print("There is no attached device.")
|
||||||
|
sio.emit('fprint-enroll-error', "There is no attached device.");
|
||||||
|
return;
|
||||||
else:
|
else:
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
if (not device):
|
if (not device):
|
||||||
|
|||||||
+8
-2
@@ -34,6 +34,12 @@ var app = new Vue({
|
|||||||
|
|
||||||
this.socket.on("connect", () => { })
|
this.socket.on("connect", () => { })
|
||||||
|
|
||||||
|
this.socket.on("fprint-enroll-error", (data) => {
|
||||||
|
console.log({ event: 'enroll-error', data });
|
||||||
|
swal("Oops!", `Operation failed. ${data}.`, "error");
|
||||||
|
this.busy.login = false;
|
||||||
|
});
|
||||||
|
|
||||||
this.socket.on("fprint-enroll-done", (data) => {
|
this.socket.on("fprint-enroll-done", (data) => {
|
||||||
console.log({ event: 'enroll-done', data});
|
console.log({ event: 'enroll-done', data});
|
||||||
if (data.ok) {
|
if (data.ok) {
|
||||||
@@ -102,10 +108,10 @@ var app = new Vue({
|
|||||||
saveFingerPrint: async function () {
|
saveFingerPrint: async function () {
|
||||||
this.busy.login = true;
|
this.busy.login = true;
|
||||||
try {
|
try {
|
||||||
var fingerprints = Object.keys(this.fingerprints).map(finger => {
|
var fingerprints = Object.keys(this.fingerDetails).map(finger => {
|
||||||
return {
|
return {
|
||||||
finger,
|
finger,
|
||||||
fingerprint: this.fingerprints[finger]
|
fingerprint: this.fingerDetails[finger]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var { data } = await axios.post(
|
var { data } = await axios.post(
|
||||||
|
|||||||
Reference in New Issue
Block a user