(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-1c358b26"],{"1bab":function(e,t,s){"use strict";s.d(t,"a",(function(){return o}));s("d3b7"),s("8237");var a=s("2b0e"),n=s("4328"),r=s.n(n);s("3a34");function o(e,t,s){return new Promise((function(n,o){var i={data:JSON.stringify(t)},u="60000";null!=s&&(u=s+"");var l=parseInt(u);e=e+"?"+(new Date).getTime()+Math.random()+Math.ceil(-89999*Math.random()+99999),a.default.prototype.$http.post(e,r.a.stringify(i),{timeout:l}).then((function(e){n(e)})).catch((function(e){o(e)}))}))}},"4a4f":function(e,t,s){"use strict";s("cc6e")},b9fa:function(e,t,s){"use strict";s.r(t);s("ac1f"),s("1276"),s("5319");var a=s("1bab"),n={name:"user-setting",data:function(){return{userInfo:{username:null,email:null,password:null},passwordTow:null}},mounted:function(){this.$Spin.show(),this.getDatas()},methods:{getDatas:function(){var e=this;Object(a.a)("/admin/getUserInfo",{}).then((function(t){if(e.$Spin.hide(),200==t.status){var s=t.data.data;"200"==t.data.code?(e.userInfo.username=s.username,e.userInfo.email=s.email):e.$Message.error(t.data.info)}else e.$Message.error("请求时出现错误")})).catch((function(t){console.log(t),e.$Message.error("服务器请求错误")}))},SaveUserConfig:function(){var e=this;if(null!=this.userInfo.password){new Array;if(1!=this.userInfo.password.split(" ").length)return this.$Message.warning("密码不能包含空格"),!1;if(this.userInfo.password!=this.passwordTow)return this.$Message.warning("密码输入不一致，请重新输入"),!1;if(this.userInfo.password.length>50)return this.$Message.warning("密码过长请重新设置"),!1;if(this.userInfo.password.length<6)return this.$Message.warning("密码长度不得小于6位"),!1}if(null==this.userInfo.password||""==this.userInfo.password||null==this.passwordTow||""==this.passwordTow)return this.$Message.warning("请输入密码"),!1;this.$Spin.show(),Object(a.a)("/admin/setUserInfo",this.userInfo).then((function(t){e.$Spin.hide(),200==t.status?"200"==t.data.code?(e.$Message.success(t.data.info),setTimeout((function(){e.logout()}),2e3)):e.$Message.warning(t.data.info):e.$Message.error("请求时出现错误")})).catch((function(t){e.$Spin.hide(),console.log(t),e.$Message.error("服务器请求错误")}))},logout:function(){var e=this;this.$http("/user/logout",{}).then((function(t){if(200==t.status){var s=t.data;e.$store.state.loginStatus=!1,localStorage.removeItem("Authorization"),localStorage.removeItem("RoleLevel"),e.$router.replace(""),e.$Message.success(s.info),location.reload()}else e.$Message.error("请求时出现错误")})).catch((function(t){console.log(t),e.$Message.error("服务器请求错误")}))}},computed:{imgReviewSwitch:{get:function(){return 1==this.imgReviewFormItem.using},set:function(e){this.imgReviewFormItem.using=e?1:0}},usingSwitch:{get:function(){return 1==this.mailFormItem.using},set:function(e){this.mailFormItem.using=e?1:0}}}},r=(s("4a4f"),s("2877")),o=Object(r.a)(n,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("Layout",{staticStyle:{"margin-top":"50px"}},[s("Content",{style:{margin:"15px 20px 0"}},[s("Card",{staticClass:"cardShadow",staticStyle:{"margin-top":"10px","padding-left":"8px","padding-right":"8px"}},[s("Form",{staticStyle:{"max-width":"600px",margin:"auto"},attrs:{"label-width":100},nativeOn:{submit:function(e){e.preventDefault()}}},[s("FormItem",{attrs:{label:"用户邮箱"}},[s("Input",{attrs:{disabled:"user"==this.$store.state.RoleLevel,placeholder:"用户邮箱",maxlength:"100",size:"large"},model:{value:e.userInfo.email,callback:function(t){e.$set(e.userInfo,"email",t)},expression:"userInfo.email"}})],1),s("FormItem",{attrs:{label:"用户名"}},[s("Input",{attrs:{disabled:"user"==this.$store.state.RoleLevel,placeholder:"用户名",maxlength:"50",size:"large"},model:{value:e.userInfo.username,callback:function(t){e.$set(e.userInfo,"username",t)},expression:"userInfo.username"}})],1),s("FormItem",{attrs:{label:"密码"}},[s("Input",{attrs:{placeholder:"密码",maxlength:"50",size:"large"},model:{value:e.userInfo.password,callback:function(t){e.$set(e.userInfo,"password",t)},expression:"userInfo.password"}})],1),s("FormItem",{attrs:{label:"确认密码"}},[s("Input",{attrs:{placeholder:"确认密码",maxlength:"50",size:"large"},model:{value:e.passwordTow,callback:function(t){e.passwordTow=t},expression:"passwordTow"}})],1),s("div",{staticStyle:{"text-align":"center"}},[s("Button",{attrs:{type:"primary",shape:"circle"},on:{click:e.SaveUserConfig}},[e._v(" 保 存 ")])],1)],1)],1)],1),s("Footer",{staticClass:"layout-footer-center"},[e._v(e._s(this.$store.state.metaInfo.webname)+" © Control Panel")])],1)}),[],!1,null,"1bafd874",null);t.default=o.exports},cc6e:function(e,t,s){}}]);