diff --git a/src/layouts/Main.vue b/src/layouts/Main.vue index 8610076..bb0ab37 100644 --- a/src/layouts/Main.vue +++ b/src/layouts/Main.vue @@ -8,15 +8,15 @@ - - - - - Logoff - - - - + //- + //- + //- + //- + //- Logoff + //- + //- + //- + //- @@ -39,7 +39,7 @@ export default { components: { copyRight }, beforeDestroy () { this.$store.commit('wallet/UPDATE_ADDRESS', '') - this.$store.commit('wallet/UPDATE_SEEDSTORE', {}) + this.$store.commit('wallet/UPDATE_KEYSTORE', {}) }, data () { return { @@ -52,6 +52,7 @@ export default { openURL, logout () { this.$store.commit('wallet/UPDATE_ADDRESS', '') + this.$store.commit('wallet/UPDATE_KEYSTORE', {}) this.$router.push('/auth/login') } } diff --git a/src/pages/Auth.vue b/src/pages/Auth.vue index 1550dd1..339ce8a 100644 --- a/src/pages/Auth.vue +++ b/src/pages/Auth.vue @@ -128,11 +128,10 @@ export default { }, async register () { this.loading = true - let x = await this.setBaseUrl(this.baseUrl) + await this.setBaseUrl(this.baseUrl) this.$store.commit('user/UPDATE_PASSWORD', this.password) this.$store.commit('user/UPDATE_NAME', this.name) this.$store.commit('user/UPDATE_EMAIL', this.email) - this.generate() .then(res => { this.onReset() @@ -140,9 +139,8 @@ export default { }) .catch(err => { this.loading = false + console.error(err) }) - - this.loading = false }, login () { this.loading = true @@ -156,6 +154,7 @@ export default { this.loading = false console.error(err) }) + this.loading = false }, performAuthentication () { return this.isRegisterUser diff --git a/src/pages/Signtx.vue b/src/pages/Signtx.vue index 6508231..1c833be 100644 --- a/src/pages/Signtx.vue +++ b/src/pages/Signtx.vue @@ -1,10 +1,15 @@ - Your Keys - + + Your Keys + + + + - + @@ -39,39 +44,59 @@ export default { data () { return { scanText: 'Quick Brown Fox Jump Over a Lazy Dog', - apps:[] + apps: [] } }, methods: { ...mapActions('wallet', [ 'signMessageTx' ]), + clearOldSession () { + this.apps = this.apps.filter(app => { + if (app.color === 'green') { + return true + } else { + return false + } + }) + }, onClick () { this.signMessageTx(this.scanText) .then(res => { - - var today = new Date(); - var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds(); - + this.apps = this.apps.filter(app => { + app.icon = 'lock' + app.color = 'orange' + return app + }) + var today = new Date() + // var time = today.getHours() + ':' + today.getMinutes() + ':' + today.getSeconds() let app = {} app.id = Date.now() - app.login_time = time - app.name = 'Ae Laboratory '+'SSO' + app.login_time = today + app.name = 'Ae Laboratory ' + 'SSO' app.color = 'green' + app.icon = 'lock_open' this.apps.push(app) }) .catch(err => { console.error(err) }) } - }, - computed: { - sortedApps() { - return this.apps.reverse - } - }, + } } diff --git a/src/store/wallet/actions.js b/src/store/wallet/actions.js index 5d694af..a261eb9 100644 --- a/src/store/wallet/actions.js +++ b/src/store/wallet/actions.js @@ -75,6 +75,8 @@ export function generate ({ state, commit, rootState, dispatch }, value) { if (res.data.status === 'SUCCESS') { dispatch('addSeedStore', randomSeed) resolve(randomSeed) + commit('UPDATE_KEYSTORE', {}) + this.$router.push('/auth/login') } else { Notify.create({