Quellcode durchsuchen

fix appLogin when already logged in

pull/13/head
Jonathan Cobb vor 4 Jahren
Ursprung
Commit
9a3cc256e6
5 geänderte Dateien mit 20 neuen und 5 gelöschten Zeilen
  1. +4
    -1
      src/_store/account.module.js
  2. +2
    -2
      src/account/profile/ProfilePage.vue
  3. +1
    -1
      src/admin/AccountsPage.vue
  4. +5
    -1
      src/app/App.vue
  5. +8
    -0
      src/auth/AppLoginPage.vue

+ 4
- 1
src/_store/account.module.js Datei anzeigen

@@ -258,7 +258,10 @@ const mutations = {
state.user = null;
},

appLoginRequest(state) {},
appLoginRequest(state) {
state.loginError = null;
state.status = Object.assign({}, state.status, {loggingIn: true});
},
appLoginSuccess(state, {user, uri}) {
if (user.token) {
if (util.currentUser() === null) {


+ 2
- 2
src/account/profile/ProfilePage.vue Datei anzeigen

@@ -219,9 +219,9 @@
watch: {
user (u) {
if (u) {
console.log('watch.user: received: '+JSON.stringify(u));
// console.log('watch.user: received: '+JSON.stringify(u));
if (this.submitted) {
console.log('watch.user: action was successful, refreshing page');
// console.log('watch.user: action was successful, refreshing page');
if (this.me) {
this.$router.push('/');
} else if (this.admin) {


+ 1
- 1
src/admin/AccountsPage.vue Datei anzeigen

@@ -105,7 +105,7 @@
watch: {
users (uList) {
if (uList !== null && this.lastAction !== null) {
console.log('watch.users: updated, refreshing...');
// console.log('watch.users: updated, refreshing...');
this.lastAction = null;
this.refreshData()
}


+ 5
- 1
src/app/App.vue Datei anzeigen

@@ -87,7 +87,11 @@ export default {
} else {
const user = util.currentUser();
if (user !== null && (typeof user.token !== 'undefined' && user.token !== null)) {
this.checkSession({messages: this.messages, errors: this.errors});
if (this.status.loggingIn || this.status.loggedIn) {
// console.log('activated: this.status.loggingIn='+this.status.loggingIn+', this.status.loggedIn='+this.status.loggedIn+', not checking session');
} else {
this.checkSession({messages: this.messages, errors: this.errors});
}
}
}
},


+ 8
- 0
src/auth/AppLoginPage.vue Datei anzeigen

@@ -53,6 +53,14 @@
methods: {
...mapActions('account', ['login', 'logout', 'appLogin']),
...mapActions('system', ['loadSystemConfigs', 'loadMessages']),
},
watch: {
user (u) {
if (u.token) {
this.loadMessages('post_auth', u.locale);
this.loadMessages('apps', u.locale);
}
}
}
};
</script>

Laden…
Abbrechen
Speichern