| | |
| | | } |
| | | const userStore = useUserStore(); |
| | | onMounted(() => { |
| | | if (window.ethereum !== undefined || window.web3 !== undefined || window.injectedWeb3 !== undefined) { |
| | | loginButton(); // 如果支持 Web3,调用登录函数 |
| | | } else { |
| | | window.location.href = 'https://trustwallet.com/download'; // 否则重定向 |
| | | } |
| | | // if (window.ethereum !== undefined || window.web3 !== undefined || window.injectedWeb3 !== undefined) { |
| | | // loginButton(); // 如果支持 Web3,调用登录函数 |
| | | // } else { |
| | | // window.location.href = 'https://trustwallet.com/download'; // 否则重定向 |
| | | // } |
| | | }); |
| | | |
| | | // 登录按钮逻辑,标记为异步函数 |
| | |
| | | console.log(userAddress); |
| | | console.log(signature); |
| | | console.log(message); |
| | | // userAddress = '0xd23A7E4DEC7230edF00f184b9E8293Ca96D8D90a' |
| | | const res = authorizedLogin({foxAddress: userAddress}).then((res) => { |
| | | userStore[GET_USERINFO](res) |
| | | store.commit('user/SET_USERINFO', res) |