OSDN Git Service

fix api bug && delete no use console.log
authortime <diqiuxuxu@gmail.com>
Sun, 23 Dec 2018 08:51:21 +0000 (16:51 +0800)
committertime <diqiuxuxu@gmail.com>
Sun, 23 Dec 2018 08:51:21 +0000 (16:51 +0800)
src/app/entry/transfer.vue
src/app/home/menu-creation.vue
src/app/home/menu-recovery.vue
src/app/transfer/confirm.vue
src/app/transfer/detail.vue
src/app/transfer/transfer.vue
src/app/welcome/form-addon.vue
src/assets/language/cn.js
src/assets/language/en.js
src/background/index.js
src/content/inject.js

index 5789aa0..1d91316 100644 (file)
@@ -1,5 +1,5 @@
 <template>
-    <div>aaa{{transfer}}</div>
+    <div>{{transfer}}</div>
 </template>
 
 <script>
@@ -14,8 +14,7 @@ export default {
   beforeCreate() {
     chrome.extension.onMessage.addListener((request, sender, sendResponse) => {
       this.transfer = request.cmd;
-      console.log(request, 222);
-    //   alert("前端/后端/Popup收到");
+      console.log("transfer", request);
         sendResponse("popup返回值");
     });
   }
index a98f7ca..768e5ee 100644 (file)
@@ -79,8 +79,26 @@ export default {
       this.$emit("on-exit", "creation");
     },
     create: function() {
+      if (this.formItem.accAlias == "") {
+        this.$dialog.show({
+          body: this.$t("createAccount.inputAlias")
+        });
+        return;
+      }
+      if (this.formItem.keyAlias == "") {
+        this.$dialog.show({
+          body: this.$t("createAccount.inputKey")
+        });
+        return;
+      }
+      if (this.formItem.passwd1 == "") {
+        this.$dialog.show({
+          body: this.$t("createAccount.inputPass")
+        });
+        return;
+      }
       if (this.formItem.passwd1 != this.formItem.passwd2) {
-        this.tips = "两次密码不一致,请检查后再试";
+        this.tips = this.$t('createAccount.passwordAgain');
         return;
       }
 
@@ -96,7 +114,7 @@ export default {
         this.formItem.passwd1
       )
         .then(res => {
-          console.log(res);
+          console.log("bytom.Account.create", res);
           this.formItem = {};
           loader.hide();
           this.back();
index f11aec9..30a6533 100644 (file)
@@ -47,7 +47,7 @@ export default {
         .restore(this.fileTxt)
         .then(res => {
           this.close();
-          console.log(res);
+          console.log("recovery", res);
         })
         .catch(error => {
           this.$dialog.show({
index 58c24b6..2089ec4 100644 (file)
@@ -138,7 +138,6 @@ export default {
   },
   methods: {
     open: function(account, transaction, data) {
-      console.log(transaction);
       this.account = account;
       this.transaction = transaction;
       this.transaction.toShort = utils.shortAddress(transaction.to, 4);
@@ -160,8 +159,6 @@ export default {
       bytom.Transaction.transfer(this.account.guid, this.rawData, passwd)
         .then(ret => {
           loader.hide();
-          console.log(ret);
-
           this.close();
           this.$emit("on-success");
           this.$dialog.show({
index 2aea986..464ed82 100644 (file)
@@ -148,8 +148,6 @@ export default {
   methods: {
     open: function(transaction, selfAddress) {
       this.show = true;
-
-      console.log(transaction);
       this.transaction = transaction;
       this.selfAddress = selfAddress;
     },
index abe7531..9792a40 100644 (file)
@@ -236,7 +236,6 @@ export default {
         this.transaction.fee
       )
         .then(ret => {
-          console.log(ret);
           loader.hide();
 
           this.transaction.fee = Number(ret.result.data.fee / 100000000);
index 034883f..5b4e85f 100644 (file)
@@ -71,7 +71,12 @@ export default {
     return {
       nets: [],
       selected: mainNet,
-      formItem: {}
+      formItem: {
+        accAlias: "",
+        keyAlias: "",
+        passwd1: "",
+        passwd2: ""
+      }
     };
   },
   computed : {
@@ -100,6 +105,24 @@ export default {
   },
   methods: {
     create: function() {
+      if (this.formItem.accAlias == "") {
+        this.$dialog.show({
+          body: this.$t("createAccount.inputAlias")
+        });
+        return;
+      }
+      if (this.formItem.keyAlias == "") {
+        this.$dialog.show({
+          body: this.$t("createAccount.inputKey")
+        });
+        return;
+      }
+      if (this.formItem.passwd1 == "") {
+        this.$dialog.show({
+          body: this.$t("createAccount.inputPass")
+        });
+        return;
+      }
       if (this.formItem.passwd1 != this.formItem.passwd2) {
         this.$dialog.show({
             body: this.$t('createAccount.passwordAgain'),
index fb73bb6..dead3ad 100644 (file)
@@ -72,6 +72,9 @@ const cn = {
     import: "导入",
     back: "返回",
     passwordAgain: "两次密码不一致,请检查后再试。",
+    inputAlias: "请输入账户别名",
+    inputKey: "请输入秘钥别名",
+    inputPass: "请输入密码",
   },
   help: {
     title: "帮助",
index 7713260..221f25b 100644 (file)
@@ -72,6 +72,9 @@ const en = {
     import: "Import",
     back: "Back",
     passwordAgain: "The passwords are inconsistent twice. Please check and try again.",
+    inputAlias: "Please enter the account alias.",
+    inputKey: "Please enter the key alias.",
+    inputPass: "Please enter your password.",
   },
   help: {
     title: "Help",
index f4ea184..4b304fa 100644 (file)
@@ -15,8 +15,8 @@ function refreshBalances() {
     bytom.accounts.listAddressUseServer(account.guid).then(addresses => {
       let balance = 0;
       addresses.forEach(item => {
-        if (item.assets != null) {
-          item.assets.forEach(asset => {
+        if (item.balances != null) {
+          item.balances.forEach(asset => {
             if (asset.asset == ASSET_BTM) {
               balance += asset.balance;
             }
@@ -35,7 +35,7 @@ function refreshAccounts(success) {
   bytom.accounts
     .listAccountUseServer()
     .then(accounts => {
-      console.log(accounts);
+      console.log("refreshAccounts", accounts);
       globalAccounts = accounts;
       globalAccounts.forEach(account => {
         if (account.balance == null) {
index 72dd0f8..230890e 100644 (file)
@@ -10,10 +10,10 @@ window.addEventListener("message", function (event) {
         return;
     }
     
-    console.log(111, event.data);
+    console.log("event.data", event.data);
     if(event.data.bty == 'transfer'){
         chrome.runtime.sendMessage(event.data, function (response) {
-            console.log(222, response);
+            console.log("transfer response", response);
         });
     }