(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/my/userInfo/index"],{"882a":function(e,t,a){"use strict";a.r(t);var n=a("a7ec"),o=a.n(n);for(var r in n)["default"].indexOf(r)<0&&function(e){a.d(t,e,(function(){return n[e]}))}(r);t["default"]=o.a},"939f":function(e,t,a){},a7ec:function(e,t,a){"use strict";(function(e){var n=a("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(a("2eee")),r=n(a("c973")),u=a("e7b1"),c=n(a("0078")),s={data:function(){return{picBase:this.$picBase2,mode:0,userInfo:null}},onLoad:function(){this.getUserInfo()},methods:{onChooseAvatar:function(e){console.log("onChooseAvatar(e)------e",e.detail.avatarUrl),this.upImg(e.detail.avatarUrl)},updateUserInfo:function(){var t=this;return(0,r.default)(o.default.mark((function a(){var n,r,c;return o.default.wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(n=/^[1][3,4,5,7,8,9][0-9]{9}$/,t.userInfo.avatar){a.next=3;break}return a.abrupt("return",t.$toast("请上传头像"));case 3:if(t.userInfo.name){a.next=5;break}return a.abrupt("return",t.$toast("请输入昵称"));case 5:if(t.userInfo.mobile&&n.test(t.userInfo.mobile)){a.next=7;break}return a.abrupt("return",t.$toast("请输入合法的手机号"));case 7:return r={name:t.userInfo.name,avatar:t.userInfo.avatar,mobile:t.userInfo.mobile},t.userInfo,console.log("更新用户信息参数--------",r),a.next=12,(0,u.updateUserInfo)(r);case 12:c=a.sent,console.log("更新用户信息返回值--------",c),0==c.code?(t.$toast("保存成功"),setTimeout((function(){e.navigateBack()}),1500)):t.$toast(c.message);case 15:case"end":return a.stop()}}),a)})))()},getUserInfo:function(){var t=this;return(0,r.default)(o.default.mark((function a(){var n;return o.default.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,(0,u.getUserInfo)();case 2:n=a.sent,console.log("用户信息返回值--------2",n),0==n.code?(e.setStorageSync("userInfo",n.data),t.userInfo=n.data):t.$toast(n.message);case 5:case"end":return a.stop()}}),a)})))()},logoOut:function(){e.showModal({title:"提示",content:"确认退出登录?",confirmColor:"#017AFF",success:function(t){t.confirm?(e.removeStorageSync("token"),e.removeStorageSync("userInfo"),e.reLaunch({url:"/pages/my/index"})):t.cancel&&console.log("用户点击取消")}})},upImg:function(t){console.log("upImg的file",t);var a=this;e.uploadFile({url:c.default.baseUrl+"/api/avatar/upload",filePath:t,name:"file",header:{"Content-Type":"multipart/form-data",Authorization:e.getStorageSync("token")},formData:{fileType:"images",dirName:"cert",tag:"lamp"},success:function(e){var t=JSON.parse(e.data);0==t.code&&(a.userInfo.avatar=t.data.url,console.log("上传后的头像url地址",t.data.url))},fail:function(e){console.log("upload failed:",e)}})}}};t.default=s}).call(this,a("543d")["default"])},a808:function(e,t,a){"use strict";(function(e,t){var n=a("4ea4");a("1c90");n(a("66fd"));var o=n(a("b26d"));e.__webpack_require_UNI_MP_PLUGIN__=a,t(o.default)}).call(this,a("bc2e")["default"],a("543d")["createPage"])},b26d:function(e,t,a){"use strict";a.r(t);var n=a("dec1"),o=a("882a");for(var r in o)["default"].indexOf(r)<0&&function(e){a.d(t,e,(function(){return o[e]}))}(r);a("f835");var u=a("f0c5"),c=Object(u["a"])(o["default"],n["b"],n["c"],!1,null,"1592abab",null,!1,n["a"],void 0);t["default"]=c.exports},dec1:function(e,t,a){"use strict";a.d(t,"b",(function(){return n})),a.d(t,"c",(function(){return o})),a.d(t,"a",(function(){}));var n=function(){var e=this.$createElement;this._self._c},o=[]},f835:function(e,t,a){"use strict";var n=a("939f"),o=a.n(n);o.a}},[["a808","common/runtime","common/vendor"]]]);