/*! * build: Hopaheal * copyright: Mead * time: 2022-9-23 10:41:22 */ (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-17e4ce20"],{"49a1":function(e,s,t){"use strict";t("911d")},"911d":function(e,s,t){},a965b:function(e,s,t){"use strict";t.r(s);var r=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{staticClass:"container"},[t("el-form",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],ref:"current_user",attrs:{"label-width":"120px",model:e.current_user,rules:e.rules}},[t("el-form-item",{attrs:{label:"账号",prop:"account"}},[t("el-input",{attrs:{disabled:!0},model:{value:e.current_user.username,callback:function(s){e.$set(e.current_user,"username",s)},expression:"current_user.username"}})],1),t("el-form-item",{attrs:{label:"名字",prop:"name"}},[t("el-input",{model:{value:e.current_user.name,callback:function(s){e.$set(e.current_user,"name",s)},expression:"current_user.name"}})],1),t("el-form-item",{attrs:{label:"状态",prop:"status"}},[t("el-radio-group",{model:{value:e.current_user.status,callback:function(s){e.$set(e.current_user,"status",s)},expression:"current_user.status"}},[t("el-radio",{attrs:{label:1}},[e._v("正常")]),t("el-radio",{attrs:{label:2}},[e._v("禁用")])],1)],1),e.head_url?t("el-form-item",{attrs:{label:""}},[t("img",{staticClass:"head_img",attrs:{alt:"",src:e.head_url}})]):e._e(),t("el-form-item",{attrs:{label:"头像",prop:"headimg"}},[t("el-upload",{staticClass:"upload-demo",attrs:{action:e.action,data:e.uploadData,"file-list":e.fileList,limit:e.limit,"list-type":"picture","on-success":e.uploadSuccess}},[t("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.clearFile}},[e._v(" "+e._s(e.head_url?"重新上传":"上传照片")+" ")]),t("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v(" 只能上传jpg/png文件,且不超过500kb(建议尺寸:150*150) ")])],1)],1),t("el-form-item",{attrs:{label:"密码",prop:"password"}},[t("el-input",{attrs:{"show-password":"",type:"password"},model:{value:e.current_user.password,callback:function(s){e.$set(e.current_user,"password",s)},expression:"current_user.password"}})],1),t("el-form-item",{attrs:{label:"确认密码",prop:"password_confirmation"}},[t("el-input",{attrs:{"show-password":"",type:"password"},model:{value:e.current_user.password_confirmation,callback:function(s){e.$set(e.current_user,"password_confirmation",s)},expression:"current_user.password_confirmation"}})],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{type:"primary"},on:{click:e.do_reset}},[e._v("保存信息")])],1)],1)},a=[],i=t("c24f"),o=t("7736"),l=t("f121"),u={data(){return{current_user:{},rules:{name:[{required:!0,trigger:"blur",message:"请输入姓名"}],status:[{required:!0,trigger:"blur",message:"请选择状态"}],headimg:[{required:!0,trigger:"blur",message:"请上传本人照片"}]},action:"",uploadData:{file_type:"img",type:"user_headimg"},limit:1,head_url:"",tea_type:0,listLoading:!0}},async created(){this.action=l["baseURL"]+"/common/upload",this.fileList=[],await this.getUser()},methods:{...Object(o["b"])({setAvatar:"user/setAvatar"}),uploadSuccess(e){console.log(e,"图片上传成功"),this.current_user.headimg=e.data.path},clearFile(){console.log("上传之前"),this.head_url=""},async getUser(){this.listLoading=!0;const{data:e}=await Object(i["getUserInfo"])();console.log(e,"个人中心编辑"),this.current_user=e,this.head_url=e.headimg,this.listLoading=!1},do_reset(){let e=this.current_user.password,s=this.current_user.password_confirmation;console.log(e,this.current_user.password,"密码?"),console.log(s,this.current_user.password_confirmation,"确认密码?"),void 0!=e&&void 0!=s?e===s?this.$refs["current_user"].validate(async e=>{if(e){const{message:e}=await Object(i["userEdit"])(this.current_user);this.$baseMessage(e,"success",!1,"vab-hey-message-success"),await this.getUser(),this.setAvatar(this.current_user.headimg),this.listLoading=!1,this.fileList=[]}}):this.$message.error("密码 两次输入不一致"):this.$message.error("请您填写两次密码!")}}},n=u,c=(t("49a1"),t("0b56")),d=Object(c["a"])(n,r,a,!1,null,"21279f26",null);s["default"]=d.exports}}]);