Browse Source

Merge branch 'dev' of http://120.92.132.192:23541/web/mymymoba_vue into dev

panmeiyu 3 years ago
parent
commit
96069d45f6
4 changed files with 494 additions and 8 deletions
  1. 2 0
      .gitignore
  2. 489 0
      package-lock.json
  3. 2 4
      src/wallet/BinanceChain.js
  4. 1 4
      src/wallet/WalletConnect.js

+ 2 - 0
.gitignore

@@ -1,6 +1,8 @@
 .DS_Store
 node_modules
 /dist
+package-lock
+moba2-17
 
 # local env files
 .env.local

File diff suppressed because it is too large
+ 489 - 0
package-lock.json


+ 2 - 4
src/wallet/BinanceChain.js

@@ -8,7 +8,7 @@ let walletMgr;
 
 async function init(_walletMgr,fun){
     walletMgr = _walletMgr;
-    CodeEnum = walletconfig.ReturnCodeEnum;
+    CodeEnum  = walletMgr.ReturnCodeEnum;
     bscConnector = new BscConnector({
         supportedChainIds: [56, 97] 
     })
@@ -29,12 +29,10 @@ async function connectWallectAccount(fun){
     walletMgr.currentAccount =  account;
     let chainId = await bscConnector.getChainId();
     walletMgr.currentChaidId = chainId;
-    walletMgr.crateContract(act.provider);
-   // func({code:CodeEnum.SUCCESS,data:account});
 
     if(walletMgr.currentChaidId == walletMgr.currentChain[0].chainId && walletMgr.currentAccount != null){
         fun({code:CodeEnum.SUCCESS,data:walletMgr.currentAccount});
-        walletMgr.crateContract(provider)
+        walletMgr.crateContract(act.provider)
     }else{
         fun({code:CodeEnum.NOT_CURRENT_CHAIN,data:"Please switch the chain"});
     }

+ 1 - 4
src/wallet/WalletConnect.js

@@ -2,17 +2,14 @@
 import WalletConnectProvider from "@walletconnect/web3-provider";
 import EventDispatcher from './EventDispatcher.js';
 import BigNumber from 'bignumber.js';
-// import constants from './Constants.js';
-//import Web3Modal from "web3modal";
 let Web3 = require('web3')
-//let web3Modal
 let walletMgr;
 let provider;
 let codeEnum
 
 function init(_walletMgr,fun){
     walletMgr = _walletMgr;
-    codeEnum = walletconfig.ReturnCodeEnum;
+    codeEnum = walletMgr.ReturnCodeEnum;
     createProvider();
     connectWallectAccount(fun)
 }

Some files were not shown because too many files changed in this diff