refactor(web): update frontend toast call sites to use the new shortcut API (#33808)

Signed-off-by: yyh <yuanyouhuilyz@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
yyh
2026-03-20 16:02:22 +08:00
committed by GitHub
parent ac87704685
commit 27ed40225d
75 changed files with 391 additions and 706 deletions

View File

@ -26,17 +26,11 @@ export default function CheckCode() {
const verify = async () => {
try {
if (!code.trim()) {
toast.add({
type: 'error',
title: t('checkCode.emptyCode', { ns: 'login' }),
})
toast.error(t('checkCode.emptyCode', { ns: 'login' }))
return
}
if (!/\d{6}/.test(code)) {
toast.add({
type: 'error',
title: t('checkCode.invalidCode', { ns: 'login' }),
})
toast.error(t('checkCode.invalidCode', { ns: 'login' }))
return
}
setIsLoading(true)
@ -47,10 +41,7 @@ export default function CheckCode() {
router.push(`/signup/set-password?${params.toString()}`)
}
else {
toast.add({
type: 'error',
title: t('checkCode.invalidCode', { ns: 'login' }),
})
toast.error(t('checkCode.invalidCode', { ns: 'login' }))
}
}
catch (error) { console.error(error) }