mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 08:14:25 +08:00
change some error message dialog to error message toast
This commit is contained in:
@@ -175,7 +175,7 @@ export default {
|
||||
const data = response.data;
|
||||
|
||||
if (!data || !data.success || !data.result || !self.$utilities.isBoolean(data.result.enable)) {
|
||||
self.$alert('Unable to get current two factor authentication status', () => {
|
||||
self.$toast('Unable to get current two factor authentication status', () => {
|
||||
router.back();
|
||||
});
|
||||
return;
|
||||
@@ -187,11 +187,11 @@ export default {
|
||||
self.$logger.error('failed to get 2fa status', error);
|
||||
|
||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
||||
self.$alert({ error: error.response.data }, () => {
|
||||
self.$toast({ error: error.response.data }, () => {
|
||||
router.back();
|
||||
});
|
||||
} else if (!error.processed) {
|
||||
self.$alert('Unable to get current two factor authentication status', () => {
|
||||
self.$toast('Unable to get current two factor authentication status', () => {
|
||||
router.back();
|
||||
});
|
||||
}
|
||||
@@ -213,7 +213,7 @@ export default {
|
||||
const data = response.data;
|
||||
|
||||
if (!data || !data.success || !data.result || !data.result.qrcode || !data.result.secret) {
|
||||
self.$alert('Unable to enable two factor authentication');
|
||||
self.$toast('Unable to enable two factor authentication');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -228,9 +228,9 @@ export default {
|
||||
self.$hideLoading();
|
||||
|
||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
||||
self.$alert({error: error.response.data});
|
||||
self.$toast({error: error.response.data});
|
||||
} else if (!error.processed) {
|
||||
self.$alert('Unable to enable two factor authentication');
|
||||
self.$toast('Unable to enable two factor authentication');
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -249,7 +249,7 @@ export default {
|
||||
const data = response.data;
|
||||
|
||||
if (!data || !data.success || !data.result || !data.result.token) {
|
||||
self.$alert('Unable to enable two factor authentication');
|
||||
self.$toast('Unable to enable two factor authentication');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -272,9 +272,9 @@ export default {
|
||||
self.$hideLoading();
|
||||
|
||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
||||
self.$alert({error: error.response.data});
|
||||
self.$toast({error: error.response.data});
|
||||
} else if (!error.processed) {
|
||||
self.$alert('Unable to enable two factor authentication');
|
||||
self.$toast('Unable to enable two factor authentication');
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -298,7 +298,7 @@ export default {
|
||||
const data = response.data;
|
||||
|
||||
if (!data || !data.success || !data.result) {
|
||||
self.$alert('Unable to disable two factor authentication');
|
||||
self.$toast('Unable to disable two factor authentication');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -312,9 +312,9 @@ export default {
|
||||
self.$hideLoading();
|
||||
|
||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
||||
self.$alert({error: error.response.data});
|
||||
self.$toast({error: error.response.data});
|
||||
} else if (!error.processed) {
|
||||
self.$alert('Unable to disable two factor authentication');
|
||||
self.$toast('Unable to disable two factor authentication');
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -338,7 +338,7 @@ export default {
|
||||
const data = response.data;
|
||||
|
||||
if (!data || !data.success || !data.result || !data.result.recoveryCodes || !data.result.recoveryCodes.length) {
|
||||
self.$alert('Unable to regenerate two factor authentication backup codes');
|
||||
self.$toast('Unable to regenerate two factor authentication backup codes');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -353,9 +353,9 @@ export default {
|
||||
self.$hideLoading();
|
||||
|
||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
||||
self.$alert({error: error.response.data});
|
||||
self.$toast({error: error.response.data});
|
||||
} else if (!error.processed) {
|
||||
self.$alert('Unable to regenerate two factor authentication backup codes');
|
||||
self.$toast('Unable to regenerate two factor authentication backup codes');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user