mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 07:57:33 +08:00
change some error message dialog to error message toast
This commit is contained in:
@@ -60,7 +60,7 @@ export default {
|
||||
const data = response.data;
|
||||
|
||||
if (!data || !data.success || !data.result) {
|
||||
self.$alert('Unable to get session list', () => {
|
||||
self.$toast('Unable to get session list', () => {
|
||||
router.back();
|
||||
});
|
||||
return;
|
||||
@@ -72,11 +72,11 @@ export default {
|
||||
self.$logger.error('failed to load token list', 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 session list', () => {
|
||||
self.$toast('Unable to get session list', () => {
|
||||
router.back();
|
||||
});
|
||||
}
|
||||
@@ -124,7 +124,7 @@ export default {
|
||||
const data = response.data;
|
||||
|
||||
if (!data || !data.success || !data.result) {
|
||||
self.$alert('Unable to logout from this session');
|
||||
self.$toast('Unable to logout from this session');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -141,9 +141,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 logout from this session');
|
||||
self.$toast('Unable to logout from this session');
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -163,7 +163,7 @@ export default {
|
||||
const data = response.data;
|
||||
|
||||
if (!data || !data.success || !data.result) {
|
||||
self.$alert('Unable to logout all other sessions');
|
||||
self.$toast('Unable to logout all other sessions');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -180,9 +180,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 logout all other sessions');
|
||||
self.$toast('Unable to logout all other sessions');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@@ -174,7 +174,7 @@ export default {
|
||||
const data = response.data;
|
||||
|
||||
if (!data || !data.success || !data.result) {
|
||||
self.$alert('Unable to get user profile', () => {
|
||||
self.$toast('Unable to get user profile', () => {
|
||||
router.back();
|
||||
});
|
||||
return;
|
||||
@@ -192,11 +192,11 @@ export default {
|
||||
self.$logger.error('failed to get user profile', 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 user profile', () => {
|
||||
self.$toast('Unable to get user profile', () => {
|
||||
router.back();
|
||||
});
|
||||
}
|
||||
@@ -238,7 +238,7 @@ export default {
|
||||
const data = response.data;
|
||||
|
||||
if (!data || !data.success || !data.result) {
|
||||
self.$alert('Unable to update user profile');
|
||||
self.$toast('Unable to update user profile');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -260,9 +260,9 @@ export default {
|
||||
self.currentPassword = '';
|
||||
|
||||
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 update user profile');
|
||||
self.$toast('Unable to update user profile');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user