@@ -5,7 +5,6 @@ import { RelativeTime } from 'components/time/relative-time'
55import { UploadWrapper } from 'components/upload'
66import { socialKeyMap } from 'constants/social'
77import { cloneDeep , isEmpty } from 'lodash-es'
8- import type { UserModel } from 'models/user'
98import {
109 NButton ,
1110 NForm ,
@@ -17,8 +16,9 @@ import {
1716 NUploadDragger ,
1817 useMessage ,
1918} from 'naive-ui'
20- import { RESTManager , deepDiff } from 'utils'
19+ import { deepDiff , RESTManager } from 'utils'
2120import { computed , defineComponent , onMounted , ref } from 'vue'
21+ import type { UserModel } from 'models/user'
2222
2323import styles from './user.module.css'
2424
@@ -62,7 +62,7 @@ export const TabUser = defineComponent(() => {
6262 yGap = { 20 }
6363 >
6464 < NGi >
65- < NForm class = "flex flex-col justify -center items -center " >
65+ < NForm class = "flex flex-col items -center justify -center " >
6666 < NFormItem >
6767 < div class = { styles [ 'avatar' ] } >
6868 < UploadWrapper
@@ -92,7 +92,7 @@ export const TabUser = defineComponent(() => {
9292 </ NFormItem >
9393
9494 < NFormItem label = "上次登录时间" class = "!mt-4" >
95- < div class = "text-center w-full" >
95+ < div class = "w-full text-center " >
9696 < NText >
9797 { data . value . lastLoginTime ? (
9898 < RelativeTime
@@ -106,7 +106,7 @@ export const TabUser = defineComponent(() => {
106106 </ NFormItem >
107107
108108 < NFormItem label = "上次登录地址" >
109- < div class = "text-center w-full" >
109+ < div class = "w-full text-center " >
110110 { data . value . lastLoginIp ? (
111111 < IpInfoPopover
112112 trigger = { 'hover' }
@@ -195,15 +195,16 @@ export const TabUser = defineComponent(() => {
195195 </ NFormItem >
196196
197197 < NFormItem label = "社交平台 ID 录入" >
198- < KVEditor
199- options = { Object . keys ( socialKeyMap ) . map ( ( key ) => {
200- return { label : key , value : socialKeyMap [ key ] }
201- } ) }
202- onChange = { ( newValue ) => {
203- data . value . socialIds = newValue
204- } }
205- value = { data . value . socialIds || { } }
206- > </ KVEditor >
198+ < KVEditor
199+ key = { data . value . id }
200+ options = { Object . keys ( socialKeyMap ) . map ( ( key ) => {
201+ return { label : key , value : socialKeyMap [ key ] }
202+ } ) }
203+ onChange = { ( newValue ) => {
204+ data . value . socialIds = newValue
205+ } }
206+ value = { data . value . socialIds || { } }
207+ > </ KVEditor >
207208 </ NFormItem >
208209 </ NForm >
209210 </ NGi >
0 commit comments