| 12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0bfbe94f"],{2408:function(e,t,r){},"8b8c":function(e,t,r){"use strict";r("2408")},9963:function(e,t,r){"use strict";r.r(t);var s=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"mainArea"},[r("h1",{staticStyle:{"margin-bottom":"30px"}},[r("CIcon",{staticStyle:{width:"40px",height:"40px","margin-right":"30px","vertical-align":"bottom"},attrs:{size:"custom",name:"cil-user"}}),e._v("账号设置")],1),r("div",[r("CCard",[r("CCardBody",{staticClass:"m-1"},[r("h3",[e._v("基本信息")]),e._v(" "),r("span",{staticStyle:{"margin-left":"20px;"}},[e._v("修改您的用户名、密码、电话等基本信息")]),r("el-divider"),r("div",{staticClass:"formArea"},[r("h5",[e._v("展示名称")]),r("p",{staticStyle:{color:"rgb(153,153,153)"}},[e._v("其他成员将会看到您的用户昵称,绝大多数的用户会将昵称设置为自己的姓名,方便团队协作中辨认身份。")]),r("CInput",{attrs:{placeholder:"用户名"},model:{value:e.userName,callback:function(t){e.userName=t},expression:"userName"}}),r("h5",[e._v("修改密码")]),r("p",{staticStyle:{color:"rgb(153,153,153)"}},[e._v("修改您的登录密码,为了保障您的信息安全,我们建议您至少每隔3个月修改一次密码。")]),r("CInput",{attrs:{placeholder:"输入密码",type:"password",horizontal:""},model:{value:e.password,callback:function(t){e.password=t},expression:"password"}}),r("h5",[e._v("手机号码")]),r("p",{staticStyle:{color:"rgb(153,153,153)"}},[e._v("如果您没有设置手机号,建议您及时设置。")]),r("CInput",{attrs:{placeholder:"手机号码"},model:{value:e.telephone,callback:function(t){e.telephone=t},expression:"telephone"}}),r("CButton",{staticStyle:{width:"80px","margin-top":"20px"},attrs:{block:"",color:"primary"},on:{click:e.updateProf}},[e._v("保存")])],1)],1)],1)],1)])},a=[],n=r("c24f"),o={name:"AccountSetting",data:function(){return{userName:"",password:"",telephone:"18851111391",userId:""}},mounted:function(){this.userId=localStorage.getItem("userId"),this.userName=localStorage.getItem("userName"),this.getUserInfo()},computed:{},watch:{},methods:{updateProf:function(){var e=this;if(""!=this.password){var t=new FormData;t.append("username",this.userName),t.append("tel",this.telephone),t.append("password",this.password),Object(n["e"])(this.userId,t).then((function(t){e.$message.success("更新成功"),e.getUserInfo(),localStorage.setItem("userName",e.userName),e.$router.go(0)}))}else this.$message.error("请在密码输入框输入密码进行验证!")},getUserInfo:function(){Object(n["a"])(this.userId).then((function(e){}))}}},c=o,u=(r("8b8c"),r("2877")),i=Object(u["a"])(c,s,a,!1,null,"5dd86b87",null);t["default"]=i.exports},b775:function(e,t,r){"use strict";var s=r("bc3a"),a=r.n(s),n=r("5c96");r("c0d6");a.a.defaults.withCredentials=!0;var o=a.a.create({baseURL:"/api",withCredentials:!0,timeout:1e5});o.interceptors.response.use((function(e){var t=e.data;return t}),(function(e){return console.log("err"+e),e.response.data.length>1e3?Object(n["Message"])({message:"服务器出错",type:"error",duration:3e3}):Object(n["Message"])({message:e.response.data,type:"error",duration:2e4}),Promise.reject(e)})),o.interceptors.request.use((function(e){var t=window.localStorage.getItem("accessToken");return t?(e.headers.accessToken=t,e):e})),t["a"]=o},c24f:function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return o})),r.d(t,"e",(function(){return c})),r.d(t,"d",(function(){return u}));var s=r("b775");function a(e){return Object(s["a"])({url:"/v1/users/",method:"PUT",data:e})}function n(e){return Object(s["a"])({url:"/v1/users/",method:"GET",params:{user_id:e}})}function o(e){return Object(s["a"])({url:"/v1/users/".concat(e),method:"GET"})}function c(e,t){return Object(s["a"])({url:"/v1/users/".concat(e),method:"PUT",data:t})}function u(e){return Object(s["a"])({url:"/v1/users/",method:"POST",data:e})}}}]);
- //# sourceMappingURL=chunk-0bfbe94f.0ade6122.js.map
|