show confirm dialog before re-login

This commit is contained in:
MaysWind
2020-11-23 23:40:48 +08:00
parent 63499c35dd
commit 48708a5d8e
3 changed files with 12 additions and 7 deletions
+1
View File
@@ -429,6 +429,7 @@ export default {
'User has canceled or this device does not support Face ID/Touch ID': 'User has canceled or this device does not support Face ID/Touch ID', 'User has canceled or this device does not support Face ID/Touch ID': 'User has canceled or this device does not support Face ID/Touch ID',
'Failed to authenticate by Face ID/Touch ID': 'Failed to authenticate by Face ID/Touch ID', 'Failed to authenticate by Face ID/Touch ID': 'Failed to authenticate by Face ID/Touch ID',
'Face ID/Touch ID authentication is not enabled': 'Face ID/Touch ID authentication is not enabled', 'Face ID/Touch ID authentication is not enabled': 'Face ID/Touch ID authentication is not enabled',
'Are you sure you want to re-login?': 'Are you sure you want to re-login?',
'Exchange Rates Data': 'Exchange Rates Data', 'Exchange Rates Data': 'Exchange Rates Data',
'Base Currency': 'Base Currency', 'Base Currency': 'Base Currency',
'Last Updated': 'Last Updated', 'Last Updated': 'Last Updated',
+1
View File
@@ -429,6 +429,7 @@ export default {
'User has canceled or this device does not support Face ID/Touch ID': '用户已取消或当前设备不支持面容ID/指纹ID', 'User has canceled or this device does not support Face ID/Touch ID': '用户已取消或当前设备不支持面容ID/指纹ID',
'Failed to authenticate by Face ID/Touch ID': '使用面容ID或指纹ID认证失败', 'Failed to authenticate by Face ID/Touch ID': '使用面容ID或指纹ID认证失败',
'Face ID/Touch ID authentication is not enabled': '面容ID或指纹ID认证没有启用', 'Face ID/Touch ID authentication is not enabled': '面容ID或指纹ID认证没有启用',
'Are you sure you want to re-login?': '您确定要重新登录?',
'Exchange Rates Data': '汇率数据', 'Exchange Rates Data': '汇率数据',
'Base Currency': '基准货币', 'Base Currency': '基准货币',
'Last Updated': '最后更新', 'Last Updated': '最后更新',
+10 -7
View File
@@ -108,15 +108,18 @@ export default {
} }
}, },
relogin() { relogin() {
const router = this.$f7router; const self = this;
const router = self.$f7router;
this.$user.clearTokenAndUserInfo(); self.$confirm('Are you sure you want to re-login?', () => {
this.$exchangeRates.clearExchangeRates(); self.$user.clearTokenAndUserInfo();
this.$settings.clearSettings(); self.$exchangeRates.clearExchangeRates();
this.$locale.init(); self.$settings.clearSettings();
self.$locale.init();
router.navigate('/login', { router.navigate('/login', {
clearPreviousHistory: true clearPreviousHistory: true
});
}); });
} }
} }