mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-15 23:47:33 +08:00
show user nickname in settings page
This commit is contained in:
@@ -170,7 +170,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
self.$user.updateToken(data.result.token);
|
||||
self.$user.updateToken(data.result);
|
||||
router.navigate('/');
|
||||
}).catch(error => {
|
||||
hasResponse = true;
|
||||
@@ -225,7 +225,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
self.$user.updateToken(data.result.token);
|
||||
self.$user.updateToken(data.result);
|
||||
app.sheet.close('#2fa-auth-sheet');
|
||||
router.navigate('/');
|
||||
}).catch(error => {
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
<template>
|
||||
<f7-page name="home">
|
||||
<f7-page name="settings">
|
||||
<f7-navbar :title="$t('Settings')" :back-link="$t('Back')"></f7-navbar>
|
||||
<f7-block-title>{{ userNickName }}</f7-block-title>
|
||||
<f7-list>
|
||||
<f7-list-item :title="$t('User Profile')" link="#"></f7-list-item>
|
||||
<f7-list-button @click="logout">{{ $t('Log Out') }}</f7-list-button>
|
||||
</f7-list>
|
||||
<f7-block-title>{{ $t('Application') }}</f7-block-title>
|
||||
<f7-list>
|
||||
<f7-list-item
|
||||
:title="$t('Language')"
|
||||
@@ -11,7 +17,6 @@
|
||||
:value="locale">{{ lang.displayName }}</option>
|
||||
</select>
|
||||
</f7-list-item>
|
||||
<f7-list-button @click="logout">{{ $t('Log Out') }}</f7-list-button>
|
||||
</f7-list>
|
||||
</f7-page>
|
||||
</template>
|
||||
@@ -26,6 +31,9 @@ export default {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
userNickName() {
|
||||
return this.$user.getUserNickName() || this.$user.getUserName() || this.$t('User');
|
||||
},
|
||||
currentLocale: {
|
||||
get: function () {
|
||||
return this.$i18n.locale
|
||||
|
||||
@@ -107,7 +107,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof(data.result) === 'string') {
|
||||
if (typeof(data.result) === 'object') {
|
||||
self.$user.updateToken(data.result);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user