chunk-690a2502.7a816706.js 5.1 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-690a2502"],{"6f14":function(e,t,r){},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("div",[r("CCard",[r("CCardBody",{staticClass:"m-1"},[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("el-divider"),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.userInfo.username,callback:function(t){e.$set(e.userInfo,"username",t)},expression:"userInfo.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.newPassword,callback:function(t){e.newPassword=t},expression:"newPassword"}}),r("h5",[e._v("手机号码")]),r("p",{staticStyle:{color:"rgb(153,153,153)"}},[e._v("如果您没有设置手机号,建议您及时设置。")]),r("CInput",{attrs:{placeholder:"手机号码"},model:{value:e.userInfo.tel,callback:function(t){e.$set(e.userInfo,"tel",t)},expression:"userInfo.tel"}}),r("el-divider"),r("CInput",{attrs:{placeholder:"请输入原密码,点击保存更新信息",type:"password",horizontal:""},model:{value:e.password,callback:function(t){e.password=t},expression:"password"}}),r("CButton",{staticStyle:{width:"80px","margin-top":"20px"},attrs:{block:"",color:"primary"},on:{click:e.updateProf}},[e._v("保存")])],1)],1)],1)],1)])},n=[],a=r("c24f"),o={name:"AccountSetting",data:function(){return{userName:"",password:"",telephone:"18851111391",userId:"",userInfo:{username:"",phone:""},newPassword:""}},beforeMount: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("password",this.password),Object(a["e"])(t).then((function(t){if(console.log("验证密码是否正确",t),t.identify){var r=new FormData;r.append("username",e.userInfo.username),r.append("tel",e.userInfo.tel),""!=e.newPassword?(console.log("使用新的密码",e.newPassword),r.append("password",e.newPassword)):(console.log("使用老密码",e.newPassword),r.append("password",e.password)),Object(a["g"])(e.userId,r).then((function(t){e.$message.success("更新个人信息成功"),setTimeout((function(){return e.getUserInfo()}),1e3),localStorage.setItem("userName",e.userInfo.username),setTimeout((function(){e.$router.go(0)}),1e3)}))}else e.$message.error("更改失败请稍后尝试")}))}else this.$message.warning("请输入原密码!")},getUserInfo:function(){var e=this;Object(a["b"])(this.userId).then((function(t){e.userInfo=t,e.userName=t.username,console.log(t,"获取用户信息")}))}}},u=o,i=(r("ad08"),r("2877")),c=Object(i["a"])(u,s,n,!1,null,"116f545a",null);t["default"]=c.exports},ad08:function(e,t,r){"use strict";r("6f14")},b775:function(e,t,r){"use strict";var s=r("bc3a"),n=r.n(s),a=r("5c96");r("c0d6");n.a.defaults.withCredentials=!0;var o=n.a.create({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(a["Message"])({message:"服务器出错",type:"error",duration:3e3}):Object(a["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,"e",(function(){return n})),r.d(t,"d",(function(){return a})),r.d(t,"b",(function(){return o})),r.d(t,"g",(function(){return u})),r.d(t,"f",(function(){return i})),r.d(t,"c",(function(){return c})),r.d(t,"a",(function(){return d}));var s=r("b775");function n(e){return Object(s["a"])({url:"/api/v1/users/login",method:"POST",data:e})}function a(e){return Object(s["a"])({url:"/api/v1/group/user",method:"GET",params:{user_id:e}})}function o(e){return Object(s["a"])({url:"/api/v1/users/".concat(e),method:"GET"})}function u(e,t){return Object(s["a"])({url:"/api/v1/users/".concat(e,"/edit"),method:"POST",data:t})}function i(e){return Object(s["a"])({url:"/api/v1/users/",method:"POST",data:e})}function c(){return Object(s["a"])({url:"/api/v1/users/",method:"GET",params:{username:"",identify:"",is_login:"",sort:""}})}function d(){return Object(s["a"])({url:"/api/v1/users/export",method:"GET"})}}}]);