fix: 注册完成后跳转
This commit is contained in:
@@ -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 = ''
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user