为什么WalletConnect在开发模式下工作,而在生产模式下不工作?

发布于 2025-02-01 01:27:46 字数 860 浏览 3 评论 0原文

我正在与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.

development mode

production mode

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文