mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 08:44:25 +08:00
code refactor
This commit is contained in:
@@ -161,7 +161,7 @@ export default {
|
||||
self.loading = false;
|
||||
const data = response.data;
|
||||
|
||||
if (!data || !data.success || !data.result || typeof(data.result.enable) !== 'boolean') {
|
||||
if (!data || !data.success || !data.result || !self.$utils.isBoolean(data.result.enable)) {
|
||||
self.$alert('Unable to get current two factor authentication status', () => {
|
||||
router.back();
|
||||
});
|
||||
|
||||
@@ -220,11 +220,11 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof(data.result.newToken) === 'string') {
|
||||
if (self.$utils.isString(data.result.newToken)) {
|
||||
self.$user.updateToken(data.result.newToken);
|
||||
}
|
||||
|
||||
if (typeof(data.result.user) === 'object') {
|
||||
if (self.$utils.isObject(data.result.user)) {
|
||||
self.$user.updateUserInfo(data.result.user);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user