fix: 注册完成后跳转

This commit is contained in:
zhangyahui
2025-10-30 13:16:50 +08:00
parent 2ec1534289
commit 7f83a1b030
2 changed files with 12 additions and 7 deletions

View File

@@ -34,6 +34,7 @@ import { useRouter } from 'vue-router'
import { useUserInfoStore } from '@/stores'
import { streamChatAddress } from '@/api/workshop'
import { generateUUID } from '@/utils/tools'
import { showToast } from 'vant'
const router = useRouter()
const userInfoStore = useUserInfoStore()
@@ -131,7 +132,14 @@ const handleFetchMessage = (message: string) => {
credentials: 'include'
})
.then(async (response) => {
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`)
if (!response.ok) {
showToast({
message: `failed to fetch: ${response.status}`,
position: 'top',
icon: 'none'
})
throw new Error(`发起对话错误--- ${response.status}`)
}
let contentBody = ''
let buffer = ''

View File

@@ -138,12 +138,9 @@ const handleConfirm = async () => {
fetchRegisterOrLogin({ ...formData, operationType: 'REGISTER' })
.then((res) => {
if (res.success) {
showToast('注册成功')
router.push('/login')
} else {
showToast(res.message)
}
console.log('res', res)
showToast('注册成功')
router.push('/login')
})
.catch((err) => {
showToast(err.message)