mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-15 23:47:33 +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;
|
const data = response.data;
|
||||||
|
|
||||||
if (!data || !data.success || !data.result || !data.result.token) {
|
if (!data || !data.success || !data.result || !data.result.token) {
|
||||||
self.$alert('Unable to login');
|
self.$toast('Unable to login');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,9 +207,9 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
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) {
|
} else if (!error.processed) {
|
||||||
self.$alert('Unable to login');
|
self.$toast('Unable to login');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -258,7 +258,7 @@ export default {
|
|||||||
const data = response.data;
|
const data = response.data;
|
||||||
|
|
||||||
if (!data || !data.success || !data.result || !data.result.token) {
|
if (!data || !data.success || !data.result || !data.result.token) {
|
||||||
self.$alert('Unable to verify');
|
self.$toast('Unable to verify');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -281,9 +281,9 @@ export default {
|
|||||||
self.$hideLoading();
|
self.$hideLoading();
|
||||||
|
|
||||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
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) {
|
} else if (!error.processed) {
|
||||||
self.$alert('Unable to verify');
|
self.$toast('Unable to verify');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ export default {
|
|||||||
const data = response.data;
|
const data = response.data;
|
||||||
|
|
||||||
if (!data || !data.success || !data.result) {
|
if (!data || !data.success || !data.result) {
|
||||||
self.$alert('Unable to logout');
|
self.$toast('Unable to logout');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,9 +201,9 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
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) {
|
} else if (!error.processed) {
|
||||||
self.$alert('Unable to logout');
|
self.$toast('Unable to logout');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ export default {
|
|||||||
const data = response.data;
|
const data = response.data;
|
||||||
|
|
||||||
if (!data || !data.success || !data.result) {
|
if (!data || !data.success || !data.result) {
|
||||||
self.$alert('Unable to sign up');
|
self.$toast('Unable to sign up');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,9 +178,9 @@ export default {
|
|||||||
self.$hideLoading();
|
self.$hideLoading();
|
||||||
|
|
||||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
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) {
|
} else if (!error.processed) {
|
||||||
self.$alert('Unable to sign up');
|
self.$toast('Unable to sign up');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ export default {
|
|||||||
router.refreshPage();
|
router.refreshPage();
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
this.$logger.error('failed to unlock by pin code', ex);
|
this.$logger.error('failed to unlock by pin code', ex);
|
||||||
this.$alert('PIN code is wrong');
|
this.$toast('PIN code is wrong');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
relogin() {
|
relogin() {
|
||||||
|
|||||||
@@ -357,7 +357,7 @@ export default {
|
|||||||
const data = response.data;
|
const data = response.data;
|
||||||
|
|
||||||
if (!data || !data.success || !data.result) {
|
if (!data || !data.success || !data.result) {
|
||||||
self.$alert('Unable to get account', () => {
|
self.$toast('Unable to get account', () => {
|
||||||
router.back();
|
router.back();
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@@ -397,11 +397,11 @@ export default {
|
|||||||
self.$logger.error('failed to load account info', error);
|
self.$logger.error('failed to load account info', error);
|
||||||
|
|
||||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
if (error.response && error.response.data && error.response.data.errorMessage) {
|
||||||
self.$alert({ error: error.response.data }, () => {
|
self.$toast({ error: error.response.data }, () => {
|
||||||
router.back();
|
router.back();
|
||||||
});
|
});
|
||||||
} else if (!error.processed) {
|
} else if (!error.processed) {
|
||||||
self.$alert('Unable to get account', () => {
|
self.$toast('Unable to get account', () => {
|
||||||
router.back();
|
router.back();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -473,7 +473,17 @@ export default {
|
|||||||
const self = this;
|
const self = this;
|
||||||
const router = self.$f7router;
|
const router = self.$f7router;
|
||||||
|
|
||||||
let problemMessage = self.inputEmptyProblemMessage;
|
let problemMessage = self.getInputEmptyProblemMessage(self.account, false);
|
||||||
|
|
||||||
|
if (!problemMessage && self.account.type === self.$constants.account.allAccountTypes.MultiSubAccounts.toString()) {
|
||||||
|
for (let i = 0; i < self.subAccounts.length; i++) {
|
||||||
|
problemMessage = self.getInputEmptyProblemMessage(self.subAccounts[i], true);
|
||||||
|
|
||||||
|
if (problemMessage) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (problemMessage) {
|
if (problemMessage) {
|
||||||
self.$alert(problemMessage);
|
self.$alert(problemMessage);
|
||||||
@@ -535,9 +545,9 @@ export default {
|
|||||||
|
|
||||||
if (!data || !data.success || !data.result) {
|
if (!data || !data.success || !data.result) {
|
||||||
if (!self.editAccountId) {
|
if (!self.editAccountId) {
|
||||||
self.$alert('Unable to add account');
|
self.$toast('Unable to add account');
|
||||||
} else {
|
} else {
|
||||||
self.$alert('Unable to save account');
|
self.$toast('Unable to save account');
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -556,12 +566,12 @@ export default {
|
|||||||
self.$hideLoading();
|
self.$hideLoading();
|
||||||
|
|
||||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
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) {
|
} else if (!error.processed) {
|
||||||
if (!self.editAccountId) {
|
if (!self.editAccountId) {
|
||||||
self.$alert('Unable to add account');
|
self.$toast('Unable to add account');
|
||||||
} else {
|
} else {
|
||||||
self.$alert('Unable to save account');
|
self.$toast('Unable to save account');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ export default {
|
|||||||
const data = response.data;
|
const data = response.data;
|
||||||
|
|
||||||
if (!data || !data.success || !data.result) {
|
if (!data || !data.success || !data.result) {
|
||||||
self.$alert('Unable to get account list', () => {
|
self.$toast('Unable to get account list', () => {
|
||||||
router.back();
|
router.back();
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@@ -320,11 +320,11 @@ export default {
|
|||||||
self.$logger.error('failed to load account list', error);
|
self.$logger.error('failed to load account list', error);
|
||||||
|
|
||||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
if (error.response && error.response.data && error.response.data.errorMessage) {
|
||||||
self.$alert({ error: error.response.data }, () => {
|
self.$toast({ error: error.response.data }, () => {
|
||||||
router.back();
|
router.back();
|
||||||
});
|
});
|
||||||
} else if (!error.processed) {
|
} else if (!error.processed) {
|
||||||
self.$alert('Unable to get account list', () => {
|
self.$toast('Unable to get account list', () => {
|
||||||
router.back();
|
router.back();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -485,7 +485,7 @@ export default {
|
|||||||
const data = response.data;
|
const data = response.data;
|
||||||
|
|
||||||
if (!data || !data.success || !data.result) {
|
if (!data || !data.success || !data.result) {
|
||||||
self.$alert('Unable to move account');
|
self.$toast('Unable to move account');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -499,9 +499,9 @@ export default {
|
|||||||
self.$hideLoading();
|
self.$hideLoading();
|
||||||
|
|
||||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
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) {
|
} else if (!error.processed) {
|
||||||
self.$alert('Unable to move account');
|
self.$toast('Unable to move account');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -574,7 +574,7 @@ export default {
|
|||||||
const data = response.data;
|
const data = response.data;
|
||||||
|
|
||||||
if (!data || !data.success || !data.result) {
|
if (!data || !data.success || !data.result) {
|
||||||
self.$alert('Unable to delete this account');
|
self.$toast('Unable to delete this account');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -592,9 +592,9 @@ export default {
|
|||||||
self.$hideLoading();
|
self.$hideLoading();
|
||||||
|
|
||||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
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) {
|
} else if (!error.processed) {
|
||||||
self.$alert('Unable to delete this account');
|
self.$toast('Unable to delete this account');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ export default {
|
|||||||
const data = response.data;
|
const data = response.data;
|
||||||
|
|
||||||
if (!data || !data.success || !data.result) {
|
if (!data || !data.success || !data.result) {
|
||||||
self.$alert('Unable to get session list', () => {
|
self.$toast('Unable to get session list', () => {
|
||||||
router.back();
|
router.back();
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@@ -72,11 +72,11 @@ export default {
|
|||||||
self.$logger.error('failed to load token list', error);
|
self.$logger.error('failed to load token list', error);
|
||||||
|
|
||||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
if (error.response && error.response.data && error.response.data.errorMessage) {
|
||||||
self.$alert({ error: error.response.data }, () => {
|
self.$toast({ error: error.response.data }, () => {
|
||||||
router.back();
|
router.back();
|
||||||
});
|
});
|
||||||
} else if (!error.processed) {
|
} else if (!error.processed) {
|
||||||
self.$alert('Unable to get session list', () => {
|
self.$toast('Unable to get session list', () => {
|
||||||
router.back();
|
router.back();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -124,7 +124,7 @@ export default {
|
|||||||
const data = response.data;
|
const data = response.data;
|
||||||
|
|
||||||
if (!data || !data.success || !data.result) {
|
if (!data || !data.success || !data.result) {
|
||||||
self.$alert('Unable to logout from this session');
|
self.$toast('Unable to logout from this session');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,9 +141,9 @@ export default {
|
|||||||
self.$hideLoading();
|
self.$hideLoading();
|
||||||
|
|
||||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
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) {
|
} 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;
|
const data = response.data;
|
||||||
|
|
||||||
if (!data || !data.success || !data.result) {
|
if (!data || !data.success || !data.result) {
|
||||||
self.$alert('Unable to logout all other sessions');
|
self.$toast('Unable to logout all other sessions');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,9 +180,9 @@ export default {
|
|||||||
self.$hideLoading();
|
self.$hideLoading();
|
||||||
|
|
||||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
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) {
|
} 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;
|
const data = response.data;
|
||||||
|
|
||||||
if (!data || !data.success || !data.result || !self.$utilities.isBoolean(data.result.enable)) {
|
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();
|
router.back();
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@@ -187,11 +187,11 @@ export default {
|
|||||||
self.$logger.error('failed to get 2fa status', error);
|
self.$logger.error('failed to get 2fa status', error);
|
||||||
|
|
||||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
if (error.response && error.response.data && error.response.data.errorMessage) {
|
||||||
self.$alert({ error: error.response.data }, () => {
|
self.$toast({ error: error.response.data }, () => {
|
||||||
router.back();
|
router.back();
|
||||||
});
|
});
|
||||||
} else if (!error.processed) {
|
} 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();
|
router.back();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -213,7 +213,7 @@ export default {
|
|||||||
const data = response.data;
|
const data = response.data;
|
||||||
|
|
||||||
if (!data || !data.success || !data.result || !data.result.qrcode || !data.result.secret) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,9 +228,9 @@ export default {
|
|||||||
self.$hideLoading();
|
self.$hideLoading();
|
||||||
|
|
||||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
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) {
|
} 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;
|
const data = response.data;
|
||||||
|
|
||||||
if (!data || !data.success || !data.result || !data.result.token) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -272,9 +272,9 @@ export default {
|
|||||||
self.$hideLoading();
|
self.$hideLoading();
|
||||||
|
|
||||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
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) {
|
} 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;
|
const data = response.data;
|
||||||
|
|
||||||
if (!data || !data.success || !data.result) {
|
if (!data || !data.success || !data.result) {
|
||||||
self.$alert('Unable to disable two factor authentication');
|
self.$toast('Unable to disable two factor authentication');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -312,9 +312,9 @@ export default {
|
|||||||
self.$hideLoading();
|
self.$hideLoading();
|
||||||
|
|
||||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
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) {
|
} 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;
|
const data = response.data;
|
||||||
|
|
||||||
if (!data || !data.success || !data.result || !data.result.recoveryCodes || !data.result.recoveryCodes.length) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,9 +353,9 @@ export default {
|
|||||||
self.$hideLoading();
|
self.$hideLoading();
|
||||||
|
|
||||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
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) {
|
} 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;
|
const data = response.data;
|
||||||
|
|
||||||
if (!data || !data.success || !data.result) {
|
if (!data || !data.success || !data.result) {
|
||||||
self.$alert('Unable to get user profile', () => {
|
self.$toast('Unable to get user profile', () => {
|
||||||
router.back();
|
router.back();
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@@ -192,11 +192,11 @@ export default {
|
|||||||
self.$logger.error('failed to get user profile', error);
|
self.$logger.error('failed to get user profile', error);
|
||||||
|
|
||||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
if (error.response && error.response.data && error.response.data.errorMessage) {
|
||||||
self.$alert({ error: error.response.data }, () => {
|
self.$toast({ error: error.response.data }, () => {
|
||||||
router.back();
|
router.back();
|
||||||
});
|
});
|
||||||
} else if (!error.processed) {
|
} else if (!error.processed) {
|
||||||
self.$alert('Unable to get user profile', () => {
|
self.$toast('Unable to get user profile', () => {
|
||||||
router.back();
|
router.back();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -238,7 +238,7 @@ export default {
|
|||||||
const data = response.data;
|
const data = response.data;
|
||||||
|
|
||||||
if (!data || !data.success || !data.result) {
|
if (!data || !data.success || !data.result) {
|
||||||
self.$alert('Unable to update user profile');
|
self.$toast('Unable to update user profile');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,9 +260,9 @@ export default {
|
|||||||
self.currentPassword = '';
|
self.currentPassword = '';
|
||||||
|
|
||||||
if (error.response && error.response.data && error.response.data.errorMessage) {
|
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) {
|
} 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