为什么WalletConnect在开发模式下工作,而在生产模式下不工作?
我正在与Moralis提供商Nodejs和ReactJS建立DAPP。 当我单击“连接”按钮时,将出现钱包连接模式。 但是有一个问题。 在开发模式下,按钮为蓝色,QR码识别可行。 在生产模式下,按钮为红色,QR码不起作用。
这是WalletConnect按钮的代码。
const { authenticate, isAuthenticated, logout } = useMoralis();
const login2 = async () => {
if (!isAuthenticated) {
await authenticate({ provider: 'walletconnect' })
.then(function(user) {
const userAddress = user.attributes.accounts[0];
console.log('logged in: ' + userAddress);
})
.catch(function(error) {
console.log(error);
});
}
};
这是正在发生的事情的图像。
I'm building a DApp with Moralis provider, Nodejs and Reactjs.
When I click the connect button, the Wallet Connect Modal appears.
But there is a problem.
When in development mode, the buttons are blue and the QR code recognition works.
In production mode, the buttons are red and the QR code doesn't work.
This is the code for the WalletConnect button.
const { authenticate, isAuthenticated, logout } = useMoralis();
const login2 = async () => {
if (!isAuthenticated) {
await authenticate({ provider: 'walletconnect' })
.then(function(user) {
const userAddress = user.attributes.accounts[0];
console.log('logged in: ' + userAddress);
})
.catch(function(error) {
console.log(error);
});
}
};
Here is the image of what is happening.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论