修复:钱包登录 SIWE statement 使用固定 ASCII,避免非英文语言解析失败。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
马丁 2026-08-05 20:59:32 +08:00
parent bd698067f8
commit 4f695953d3
6 changed files with 9 additions and 11 deletions

View File

@ -160,8 +160,7 @@
"loginFailed": "Sign in failed. Please check your credentials and try again.", "loginFailed": "Sign in failed. Please check your credentials and try again.",
"credentialsRequired": "Please enter username and password.", "credentialsRequired": "Please enter username and password.",
"captchaRequired": "Please enter the captcha.", "captchaRequired": "Please enter the captcha.",
"captchaLoadFailed": "Failed to load captcha. Please refresh and try again.", "captchaLoadFailed": "Failed to load captcha. Please refresh and try again."
"siweStatement": "Sign in to FuturePulse"
}, },
"register": { "register": {
"title": "Sign Up", "title": "Sign Up",

View File

@ -160,8 +160,7 @@
"loginFailed": "サインインに失敗しました。認証情報を確認してください。", "loginFailed": "サインインに失敗しました。認証情報を確認してください。",
"credentialsRequired": "ユーザー名とパスワードを入力してください。", "credentialsRequired": "ユーザー名とパスワードを入力してください。",
"captchaRequired": "認証コードを入力してください。", "captchaRequired": "認証コードを入力してください。",
"captchaLoadFailed": "認証コードの読み込みに失敗しました。更新して再試行してください。", "captchaLoadFailed": "認証コードの読み込みに失敗しました。更新して再試行してください。"
"siweStatement": "FuturePulse にサインイン"
}, },
"register": { "register": {
"title": "新規登録", "title": "新規登録",

View File

@ -160,8 +160,7 @@
"loginFailed": "로그인에 실패했습니다. 계정 정보를 확인해 주세요.", "loginFailed": "로그인에 실패했습니다. 계정 정보를 확인해 주세요.",
"credentialsRequired": "사용자 이름과 비밀번호를 입력해 주세요.", "credentialsRequired": "사용자 이름과 비밀번호를 입력해 주세요.",
"captchaRequired": "인증 코드를 입력해 주세요.", "captchaRequired": "인증 코드를 입력해 주세요.",
"captchaLoadFailed": "인증 코드를 불러오지 못했습니다. 새로고침 후 다시 시도해 주세요.", "captchaLoadFailed": "인증 코드를 불러오지 못했습니다. 새로고침 후 다시 시도해 주세요."
"siweStatement": "FuturePulse 로그인"
}, },
"register": { "register": {
"title": "회원가입", "title": "회원가입",

View File

@ -160,8 +160,7 @@
"loginFailed": "登录失败,请检查账号密码后重试。", "loginFailed": "登录失败,请检查账号密码后重试。",
"credentialsRequired": "请输入用户名和密码。", "credentialsRequired": "请输入用户名和密码。",
"captchaRequired": "请输入验证码。", "captchaRequired": "请输入验证码。",
"captchaLoadFailed": "验证码加载失败,请刷新后重试。", "captchaLoadFailed": "验证码加载失败,请刷新后重试。"
"siweStatement": "登录 FuturePulse"
}, },
"register": { "register": {
"title": "注册", "title": "注册",

View File

@ -160,8 +160,7 @@
"loginFailed": "登入失敗,請檢查帳號密碼後重試。", "loginFailed": "登入失敗,請檢查帳號密碼後重試。",
"credentialsRequired": "請輸入使用者名稱和密碼。", "credentialsRequired": "請輸入使用者名稱和密碼。",
"captchaRequired": "請輸入驗證碼。", "captchaRequired": "請輸入驗證碼。",
"captchaLoadFailed": "驗證碼載入失敗,請刷新後重試。", "captchaLoadFailed": "驗證碼載入失敗,請刷新後重試。"
"siweStatement": "登入 FuturePulse"
}, },
"register": { "register": {
"title": "註冊", "title": "註冊",

View File

@ -106,6 +106,9 @@ import { useUserStore } from '@/stores/user'
import { post } from '@/api/request' import { post } from '@/api/request'
import { getCaptcha, loginByPassword, parseLoginResponse, type LoginResponseData } from '@/api/auth' import { getCaptcha, loginByPassword, parseLoginResponse, type LoginResponseData } from '@/api/auth'
// EIP-4361 只允许可打印 US-ASCII 的 statement,不能本地化
const SIWE_STATEMENT = 'Sign in to FuturePulse'
const router = useRouter() const router = useRouter()
const { t } = useI18n() const { t } = useI18n()
const userStore = useUserStore() const userStore = useUserStore()
@ -213,7 +216,7 @@ const connectWithWallet = async () => {
scheme, scheme,
domain, domain,
address: signer.address, address: signer.address,
statement: t('login.siweStatement'), statement: SIWE_STATEMENT,
uri: origin, uri: origin,
version: '1', version: '1',
chainId: chainId, chainId: chainId,