v2board/public/p__profile.async.js

1 line
12 KiB
JavaScript
Raw Normal View History

2019-11-18 18:50:57 +08:00
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[18],{"9Emu":function(e,a,t){"use strict";t.r(a),t.d(a,"default",function(){return u});var n=t("jehZ"),s=t.n(n),i=(t("BoS7"),t("Sdc0")),r=(t("+L6B"),t("2/Rp")),l=(t("miYZ"),t("tsqr")),c=t("q1tI"),o=t.n(c),m=t("Bl7J"),d=t("t3Un"),p=t("3a4m"),h=t.n(p);class u extends o.a.Component{constructor(){super(...arguments),this.state={info:{},loading:!0}}componentDidMount(){this.fetchData()}fetchData(){Object(d["a"])("/user/info").then(e=>{200===e.code&&this.setState({info:e.data,loading:!1})})}changePassword(){if(this.refs.re_password.value!==this.refs.new_password.value)return l["a"].error("\u4e24\u6b21\u65b0\u5bc6\u7801\u8f93\u5165\u4e0d\u540c");Object(d["b"])("/user/changePassword",{old_password:this.refs.old_password.value,new_password:this.refs.new_password.value}).then(e=>{200===e.code&&(l["a"].success("\u4fee\u6539\u6210\u529f\uff0c\u8bf7\u91cd\u65b0\u767b\u9646"),h.a.push("/login"))})}update(e,a){this.setState({[e+"_loading"]:!0},()=>{Object(d["b"])("/user/update",{[e]:a}).then(a=>{200===a.code&&(this.fetchData(),this.setState({[e+"_loading"]:!1}))})})}render(){return o.a.createElement(m["a"],s()({},this.props,{loading:this.state.loading}),o.a.createElement("main",{id:"main-container"},o.a.createElement("div",{className:"content content-full"},o.a.createElement("h2",{className:"font-w300 mt-4 mb-3"},"\u4e2a\u4eba\u4e2d\u5fc3"),o.a.createElement("div",{className:"block block-rounded block-bordered"},o.a.createElement("div",{className:"block-header block-header-default"},o.a.createElement("h3",{className:"block-title"},"\u4fee\u6539\u5bc6\u7801"),o.a.createElement("div",{className:"block-options"},o.a.createElement(r["a"],{type:"primary",onClick:()=>this.changePassword()},"\u4fdd\u5b58"))),o.a.createElement("div",{className:"block-content"},o.a.createElement("div",{className:"row push"},o.a.createElement("div",{className:"col-lg-8 col-xl-5"},o.a.createElement("div",{className:"form-group"},o.a.createElement("label",{for:"example-text-input"},"\u65e7\u5bc6\u7801"),o.a.createElement("input",{type:"password",className:"form-control",placeholder:"\u8bf7\u8f93\u5165\u65e7\u5bc6\u7801",ref:"old_password"})),o.a.createElement("div",{className:"form-group"},o.a.createElement("label",{for:"example-text-input"},"\u65b0\u5bc6\u7801"),o.a.createElement("input",{type:"password",className:"form-control",placeholder:"\u8bf7\u8f93\u5165\u65b0\u5bc6\u7801",ref:"new_password"})),o.a.createElement("div",{className:"form-group"},o.a.createElement("label",{for:"example-text-input"},"\u65b0\u5bc6\u7801"),o.a.createElement("input",{type:"password",className:"form-control",placeholder:"\u8bf7\u786e\u8ba4\u65b0\u5bc6\u7801",ref:"re_password"})))))),o.a.createElement("div",{className:"block block-rounded block-bordered"},o.a.createElement("div",{className:"block-header block-header-default"},o.a.createElement("h3",{className:"block-title"},"\u901a\u77e5")),o.a.createElement("div",{className:"block-content"},o.a.createElement("div",{className:"row push"},o.a.createElement("div",{className:"col-lg-8 col-xl-5"},o.a.createElement("div",{className:"form-group"},o.a.createElement("label",{for:"example-text-input"},"\u5230\u671f\u90ae\u4ef6\u63d0\u9192"),o.a.createElement("div",null,o.a.createElement(i["a"],{loading:this.state.remind_expire_loading,checked:this.state.info.remind_expire,onChange:e=>this.update("remind_expire",e?1:0)}))),o.a.createElement("div",{className:"form-group"},o.a.createElement("label",{for:"example-text-input"},"\u6d41\u91cf\u90ae\u4ef6\u63d0\u9192"),o.a.createElement("div",null,o.a.createElement(i["a"],{loading:this.state.remind_traffic_loading,checked:this.state.info.remind_traffic,onChange:e=>this.update("remind_traffic",e?1:0)}))))))))))}}},Bl7J:function(e,a,t){"use strict";var n=t("q1tI"),s=t.n(n),i=t("3a4m"),r=t.n(i),l=t("/MKj");class c extends s.a.Component{constructor(){super(...arguments),this.state={nav:[]}}componentDidMount(){var e=[{title:"\u4eea\u8868\u76d8",type:"item",href:"/dashboard",icon:s.a.createElement("i",{className:"nav-main-link-icon si si-speedometer