不管logout请求结果如何,前台都必须完成登录信息清理和返回登录页

This commit is contained in:
bob
2024-09-08 00:32:59 +08:00
parent f05ae4b0c4
commit dc180ff579
2 changed files with 7 additions and 12 deletions

View File

@@ -15,21 +15,15 @@ const isLoading = ref(false)
let selectedFile
const onSelected = (file) => {
console.log('onSelected')
imgUrl.value = URL.createObjectURL(file.raw)
selectedFile = file.raw
}
const onSuccess = () => {
console.log('onSuccess')
}
const onSuccess = () => {}
const beforeUpload = () => {
console.log('beforeUpload')
}
const beforeUpload = () => {}
const onUpload = async () => {
console.log('onUpload')
if (!selectedFile) {
ElMessage.warning('您还未选择新头像!')
return

View File

@@ -44,10 +44,11 @@ const onExit = async () => {
confirmButtonText: '确认',
cancelButtonText: '取消'
})
await userLogoutnService(userData.user.account)
userData.clearAt()
userData.clearRt()
router.push('/login')
userLogoutnService(userData.user.account).finally(() => {
userData.clearAt()
userData.clearRt()
router.push('/login')
})
}
</script>