{"ast":null,"code":"export default {\n name: \"AdminPerson\",\n data() {\n return {\n user: JSON.parse(localStorage.getItem('xm-user') || '{}')\n };\n },\n created() {},\n methods: {\n update() {\n // 保存当前的用户信息到数据库\n this.$request.put('/admin/update', this.user).then(res => {\n if (res.code === '200') {\n // 成功更新\n this.$message.success('保存成功');\n\n // 更新浏览器缓存里的用户信息\n localStorage.setItem('xm-user', JSON.stringify(this.user));\n\n // 触发父级的数据更新\n this.$emit('update:user');\n } else {\n this.$message.error(res.msg);\n }\n });\n },\n handleAvatarSuccess(response, file, fileList) {\n // 把user的头像属性换成上传的图片的链接\n this.$set(this.user, 'avatar', response.data);\n }\n }\n};","map":{"version":3,"names":["name","data","user","JSON","parse","localStorage","getItem","created","methods","update","$request","put","then","res","code","$message","success","setItem","stringify","$emit","error","msg","handleAvatarSuccess","response","file","fileList","$set"],"sources":["src/views/manager/AdminPerson.vue"],"sourcesContent":["\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n 保 存\r\n
\r\n \r\n \r\n
\r\n\r\n\r\n\r\n\r\n"],"mappings":"AAoCA;EACAA,IAAA;EACAC,KAAA;IACA;MACAC,IAAA,EAAAC,IAAA,CAAAC,KAAA,CAAAC,YAAA,CAAAC,OAAA;IACA;EACA;EACAC,QAAA,GAEA;EACAC,OAAA;IACAC,OAAA;MACA;MACA,KAAAC,QAAA,CAAAC,GAAA,uBAAAT,IAAA,EAAAU,IAAA,CAAAC,GAAA;QACA,IAAAA,GAAA,CAAAC,IAAA;UACA;UACA,KAAAC,QAAA,CAAAC,OAAA;;UAEA;UACAX,YAAA,CAAAY,OAAA,YAAAd,IAAA,CAAAe,SAAA,MAAAhB,IAAA;;UAEA;UACA,KAAAiB,KAAA;QACA;UACA,KAAAJ,QAAA,CAAAK,KAAA,CAAAP,GAAA,CAAAQ,GAAA;QACA;MACA;IACA;IACAC,oBAAAC,QAAA,EAAAC,IAAA,EAAAC,QAAA;MACA;MACA,KAAAC,IAAA,MAAAxB,IAAA,YAAAqB,QAAA,CAAAtB,IAAA;IACA;EACA;AACA"},"metadata":{},"sourceType":"module","externalDependencies":[]}