之前写的登录逻辑
//判断账号密码
enroll = caClient.enroll(walletName, loginForm.getPassword());
Identity user = Identities.newX509Identity(orgEnum.getMspId(), enroll);
wallet.put(walletName, user);
//判断是否有证书,但if不可能为true
if (wallet.get(walletName) == null){
throw new CoinException("Invalid walletName or Password!");
}
现在的登录逻辑文章来源:https://www.toymoban.com/news/detail-594758.html
//判断账号密码
enroll = caClient.enroll(walletName, loginForm.getPassword());
//账号密码正确,再判断是否有证书
if (wallet.get(walletName) == null){
Identity user = Identities.newX509Identity(orgEnum.getMspId(), enroll);
wallet.put(walletName, user);
}
每次enroll时,无论账号密码是否改变,得到的Enrollment都会变化,证书文件也会发生改变,导致每次登录的时候都会对账号对应的证书重写。文章来源地址https://www.toymoban.com/news/detail-594758.html
到了这里,关于fabric-gataway-java每次连接到区块链网络时client的身份都会改变的问题的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!