(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-11f514df"],{5723:function(t,e,a){"use strict";a.d(e,"a",(function(){return o})),a.d(e,"d",(function(){return r})),a.d(e,"b",(function(){return i})),a.d(e,"c",(function(){return s}));var n=a("66df"),o=function(t){return n["a"].request({method:"post",url:"api/platform.php?s=Platform.User.Profile",data:t})},r=function(t){return n["a"].request({method:"post",url:"api/platform.php?s=Platform.User.UpdateProfile",data:t})},i=function(t){return n["a"].request({method:"post",url:"api/admin.php?s=Admin.User.GetLastestLoginRecord",data:t})},s=function(t){return n["a"].request({method:"post",url:"api/platform.php?s=Platform.User.AlterPass",data:t})}},"5a9c":function(t,e,a){t.exports=a.p+"img/headImg.8b4031b9.jpg"},a421:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"main"},[a("h3",[t._v(t._s(t.$t("modify_personal_info")))]),a("div",{staticClass:"content"},[a("div",{staticClass:"form"},[a("Form",{ref:"formCustom",attrs:{model:t.info,rules:t.ruleCustom,"label-width":80}},[a("p",{staticClass:"username"},[t._v(t._s(t.$t("account"))+"："),a("span",[t._v(t._s(t.info.username))])]),a("FormItem",{attrs:{label:t.$t("account_nickname")+":",prop:"nickname"}},[a("Input",{attrs:{clearable:""},model:{value:t.info.nickname,callback:function(e){t.$set(t.info,"nickname",e)},expression:"info.nickname"}})],1),a("FormItem",{attrs:{label:t.$t("tel")+":",prop:"moblie"}},[a("Input",{attrs:{clearable:""},model:{value:t.info.mobile,callback:function(e){t.$set(t.info,"mobile",e)},expression:"info.mobile"}})],1),a("FormItem",{attrs:{label:t.$t("email")+":",prop:"email"}},[a("Input",{attrs:{clearable:"",type:"text",number:""},model:{value:t.info.email,callback:function(e){t.$set(t.info,"email",e)},expression:"info.email"}})],1),a("FormItem",[a("Button",{staticClass:"btn",attrs:{type:"primary"},on:{click:function(e){return t.handleSubmit("formCustom")}}},[t._v(t._s(t.$t("submit")))])],1)],1)],1),a("div",{staticClass:"header"},[a("img",{attrs:{src:t.info.avatar||t.defaultHead}}),a("Button",{on:{click:t.editHead}},[t._v(t._s(t.$t("alter_avatar")))]),a("Modal",{attrs:{title:t.$t("alter_avatar"),width:"50%",closable:!0},model:{value:t.modal,callback:function(e){t.modal=e},expression:"modal"}},[t.modal?a("cropper",{ref:"info",attrs:{"crop-button-text":t.$t("confrim")},on:{transmitInfo:t.handleCroped}}):t._e(),a("div",{attrs:{slot:"footer"},slot:"footer"})],1)],1)])])},o=[],r=a("5a9c"),i=a.n(r),s=a("5723"),l=a("c24f"),c=a("c276"),u=a("9ffe"),f={components:{Cropper:u["a"]},name:"accountSettings",data:function(){return{modal:!1,defaultHead:i.a,token:Object(c["h"])(),info:{username:"",nickname:"",moblie:"",email:"",avatar:""},ruleCustom:{nickname:[{type:"string",min:1,max:20,message:this.$t("nickname_length_error_tips")}],phone:[],email:[]}}},created:function(){this.getInfo()},methods:{handleSubmit:function(){var t=this;if(this.info.moblie&&!/^1[3-9]\d{9}$/.test(this.info.moblie))return this.$Message.error(this.$t("tel_input_error"));if(this.info.email&&!/^\w+@[a-zA-Z0-9]{2,10}(?:\.[a-z]{2,4}){1,3}$/.test(this.info.email))return this.$Message.error(this.$t("email_input_error"));var e=new FormData;for(var a in e.append("access_token",this.token),this.info)this.info[a]&&e.append(a,this.info[a]);Object(s["d"])(e).then((function(e){200===e.ret?e.data.is_update?(t.$Message.success(t.$t("successfully_altered")),setTimeout((function(){t.$router.push({name:"accountInfo"})}),1e3)):t.$Message.success(t.$t("nothing_altered")):t.$Message.error(t.$t("fail_altered"))}))},getInfo:function(){var t=this,e=new FormData;e.append("access_token",this.token),Object(s["a"])(e).then((function(e){t.info=e.data.profile,t.info.avatar=e.data.profile.avatar||t.defaultHead}))},editHead:function(){this.modal=!0},handleCroped:function(t){var e=this;if(/image/i.test(t.type)){var a=new FormData;a.append("access_token",this.token),a.append("file",t.updataFile),Object(l["l"])(a).then((function(t){200===t.ret?(e.modal=!1,e.info.avatar=t.data.url||defaultHead):(e.modal=!1,e.$Message.error(e.$t("file_too_large_error_content")))}))}else this.$Message.error(this.$t("document_format_error_content")),this.modal=!1},modalCanel:function(){this.modal=!1}}},m=f,d=(a("fbc2"),a("2877")),p=Object(d["a"])(m,n,o,!1,null,"80c8c30e",null);e["default"]=p.exports},bdbf:function(t,e,a){},fbc2:function(t,e,a){"use strict";var n=a("bdbf"),o=a.n(n);o.a}}]);