mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
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:
@ -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) }
|
||||
|
||||
Reference in New Issue
Block a user