mirror of
https://gitee.com/lijingbo-2021/open-anylink-web.git
synced 2025-12-30 11:02:25 +00:00
更改邮箱和手机号码后不能及时刷新
This commit is contained in:
@@ -5,7 +5,7 @@ import { userModifySelfService } from '@/api/user'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
defineProps(['modelValue'])
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
const emit = defineEmits(['update:modelValue', 'success'])
|
||||
|
||||
const userData = userStore()
|
||||
|
||||
@@ -60,6 +60,7 @@ const onComfirm = async () => {
|
||||
res.then(() => {
|
||||
ElMessage.success('绑定邮箱修改成功')
|
||||
emit('update:modelValue', false)
|
||||
emit('success')
|
||||
})
|
||||
res.finally(() => {
|
||||
isLoading.value = false
|
||||
|
||||
@@ -5,7 +5,7 @@ import { userModifySelfService } from '@/api/user'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
defineProps(['modelValue'])
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
const emit = defineEmits(['update:modelValue', 'success'])
|
||||
|
||||
const userData = userStore()
|
||||
|
||||
@@ -60,6 +60,7 @@ const onComfirm = async () => {
|
||||
res.then(() => {
|
||||
ElMessage.success('绑定手机修改成功')
|
||||
emit('update:modelValue', false)
|
||||
emit('success')
|
||||
})
|
||||
res.finally(() => {
|
||||
isLoading.value = false
|
||||
|
||||
@@ -15,9 +15,11 @@ const formModel = ref({})
|
||||
const isLoading = ref(false)
|
||||
const isShowEditAvatar = ref(false)
|
||||
|
||||
onMounted(() => {
|
||||
formModel.value = cloneDeep(userData.user)
|
||||
formModel.value.birthday = showTimeFormat(userData.user.birthday)
|
||||
onMounted(async () => {
|
||||
userData.updateUser().then(() => {
|
||||
formModel.value = cloneDeep(userData.user)
|
||||
formModel.value.birthday = showTimeFormat(userData.user.birthday)
|
||||
})
|
||||
})
|
||||
|
||||
const onNewAvatar = ({ avatar, avatarThumb }) => {
|
||||
|
||||
@@ -26,6 +26,10 @@ const emailDesc = computed(() => {
|
||||
return '已绑定邮箱:' + userData.user.email
|
||||
}
|
||||
})
|
||||
|
||||
const onUpdateUser = () => {
|
||||
userData.updateUser()
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -71,8 +75,8 @@ const emailDesc = computed(() => {
|
||||
</div>
|
||||
|
||||
<EditPassword v-model="isShowEditPassword"></EditPassword>
|
||||
<EditPhone v-model="isShowEditPhone"></EditPhone>
|
||||
<EditEmail v-model="isShowEditEmail"></EditEmail>
|
||||
<EditPhone v-model="isShowEditPhone" @success="onUpdateUser"></EditPhone>
|
||||
<EditEmail v-model="isShowEditEmail" @success="onUpdateUser"></EditEmail>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user