mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-11 03:22:06 +00:00
fix: 修复账号信息更新消息订阅从新进入页面状态没有改变问题
This commit is contained in:
parent
242f958428
commit
d566adb644
@ -37,8 +37,7 @@ import DetailCard from '@/components/DetailCard'
|
|||||||
import QuickActions from '@/components/QuickActions'
|
import QuickActions from '@/components/QuickActions'
|
||||||
import UserConfirmDialog from '@/components/UserConfirmDialog'
|
import UserConfirmDialog from '@/components/UserConfirmDialog'
|
||||||
import { toSafeLocalDateStr } from '@/utils/common'
|
import { toSafeLocalDateStr } from '@/utils/common'
|
||||||
import { getProfile } from '@/api/users'
|
import store from '@/store'
|
||||||
import { mapState } from 'vuex'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ProfileInfo',
|
name: 'ProfileInfo',
|
||||||
@ -48,9 +47,14 @@ export default {
|
|||||||
QuickActions,
|
QuickActions,
|
||||||
UserConfirmDialog
|
UserConfirmDialog
|
||||||
},
|
},
|
||||||
|
props: {
|
||||||
|
object: {
|
||||||
|
type: Object,
|
||||||
|
default: () => store.state.users.profile
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
object: this.userProfile || {},
|
|
||||||
url: `/api/v1/users/profile/`,
|
url: `/api/v1/users/profile/`,
|
||||||
showPasswordDialog: false,
|
showPasswordDialog: false,
|
||||||
currentEdit: '',
|
currentEdit: '',
|
||||||
@ -213,9 +217,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState({
|
|
||||||
userProfile: state => state.users.profile
|
|
||||||
}),
|
|
||||||
detailCardItems() {
|
detailCardItems() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
@ -298,12 +299,6 @@ export default {
|
|||||||
return url
|
return url
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
|
||||||
getProfile().then(res => {
|
|
||||||
this.object = res
|
|
||||||
this.$store.commit('users/SET_PROFILE', res)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
updateUserReceiveBackends(val) {
|
updateUserReceiveBackends(val) {
|
||||||
this.$axios.patch(
|
this.$axios.patch(
|
||||||
@ -311,6 +306,7 @@ export default {
|
|||||||
{ 'receive_backends': this.getReceiveBackendList() }
|
{ 'receive_backends': this.getReceiveBackendList() }
|
||||||
).then(res => {
|
).then(res => {
|
||||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||||
|
this.$store.dispatch('users/getProfile', true)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.$message.error(this.$t('common.updateErrorMsg' + ' ' + err))
|
this.$message.error(this.$t('common.updateErrorMsg' + ' ' + err))
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user