OSDN Git Service

fix account balance view
authortime <diqiuxuxu@gmail.com>
Wed, 2 Jan 2019 15:12:33 +0000 (23:12 +0800)
committertime <diqiuxuxu@gmail.com>
Wed, 2 Jan 2019 15:12:33 +0000 (23:12 +0800)
src/views/home.vue

index 8f27daa..5aee681 100644 (file)
@@ -325,12 +325,8 @@ export default {
                     this.currentAccount = {};
                     return;
                 }
-
-                if (localStorage.currentAccount != undefined && localStorage.currentAccount != '{}') {
-                    this.currentAccount = JSON.parse(localStorage.currentAccount);
-                } else {
-                    this.currentAccount = accounts[0];
-                }
+                this.currentAccount = accounts[0];
+                this.refreshBalance(this.currentAccount.guid);
             })
         },
         refreshBalance: function (guid) {