You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 构造一个拥有 ABI 方法的对象functionconstructMethods(addr,abi){}// 添加请求返回拦截器functionsetInterceptor(interceptor){}export{constructMethods,setInterceptor};
业务模块中的请求使用简单定义的异步函数:
// 通过 HTTP API 获取列表asyncfunctiongetList(params){returnlegacyClient.get('/get/list',{ params });}// 通过智能合约 ABI 获取详情asyncfunctiongetOne(params){returncontractA.getOne(params);}// 通过 HTTP API 新增数据asyncfunctioninsertOne(data){returnhttpClient.post('/insert/one',data);}// 通过智能合约 ABI 修改数据asyncfunctionupdateOne(data){returncontractB.updateOne(data);}
The text was updated successfully, but these errors were encountered:
对智能合约 ABI 的调用使用
obj.method(params)
的形式替代readContract(config, { address, abi, functionName, args })
,这样更符合直觉且更简洁:业务模块中的请求使用简单定义的异步函数:
The text was updated successfully, but these errors were encountered: