修复:登录bug

This commit is contained in:
ivan 2026-03-22 19:27:49 +08:00
parent c6bb01f777
commit c329d712c5

View File

@ -85,7 +85,7 @@ const connectWithWallet = async () => {
scheme, scheme,
domain, domain,
address: signer.address, address: signer.address,
statement: t('login.siweStatement'), statement: 'Sign in to TestMarket',
uri: origin, uri: origin,
version: '1', version: '1',
chainId: chainId, chainId: chainId,
@ -114,7 +114,9 @@ const connectWithWallet = async () => {
const token = data.token as string | undefined const token = data.token as string | undefined
const user = const user =
(data.user as UserInfo | undefined) ?? (data.user as UserInfo | undefined) ??
(data.ID != null || data.id != null || data.userName != null ? (data as unknown as UserInfo) : undefined) (data.ID != null || data.id != null || data.userName != null
? (data as unknown as UserInfo)
: undefined)
userStore.setUser({ token, user }) userStore.setUser({ token, user })
await userStore.fetchUserInfo() await userStore.fetchUserInfo()
await userStore.fetchUsdcBalance() await userStore.fetchUsdcBalance()