(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/my/userInfo/index"],{"1ef2":function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){}));var a=function(){var e=this.$createElement;this._self._c},o=[]},"882a":function(e,t,n){"use strict";n.r(t);var a=n("a7ec"),o=n.n(a);for(var r in a)["default"].indexOf(r)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(r);t["default"]=o.a},a7ec:function(e,t,n){"use strict";(function(e){var a=n("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n("2eee")),r=a(n("c973")),u=n("e7b1"),s=a(n("0078")),c={data:function(){return{picBase:this.$picBase2,mode:0,userInfo:null}},onLoad:function(){this.getUserInfo()},methods:{updateUserInfo:function(){var t=this;return(0,r.default)(o.default.mark((function n(){var a,r,s;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(a=/^[1][3,4,5,7,8,9][0-9]{9}$/,t.userInfo.avatar){n.next=3;break}return n.abrupt("return",t.$toast("请上传头像"));case 3:if(t.userInfo.name){n.next=5;break}return n.abrupt("return",t.$toast("请输入昵称"));case 5:if(t.userInfo.mobile&&a.test(t.userInfo.mobile)){n.next=7;break}return n.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),n.next=12,(0,u.updateUserInfo)(r);case 12:s=n.sent,console.log("更新用户信息返回值--------",s),0==s.code?(t.$toast("保存成功"),setTimeout((function(){e.navigateBack()}),1500)):t.$toast(s.message);case 15:case"end":return n.stop()}}),n)})))()},getUserInfo:function(){var t=this;return(0,r.default)(o.default.mark((function n(){var a;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,(0,u.getUserInfo)();case 2:a=n.sent,console.log("用户信息返回值--------2",a),0==a.code?(e.setStorageSync("userInfo",a.data),t.userInfo=a.data):t.$toast(a.message);case 5:case"end":return n.stop()}}),n)})))()},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("用户点击取消")}})},upload:function(){var t=this;e.chooseImage({count:1,success:function(e){console.log("res",e.tempFilePaths[0]),t.upImg(e.tempFilePaths[0])}})},upImg:function(t){console.log("upImg的file",t);var n=this;e.uploadFile({url:s.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&&(n.userInfo.avatar=t.data.url,console.log("上传后的头像url地址",t.data.url))},fail:function(e){console.log("upload failed:",e)}})}}};t.default=c}).call(this,n("543d")["default"])},a808:function(e,t,n){"use strict";(function(e,t){var a=n("4ea4");n("1c90");a(n("66fd"));var o=a(n("b26d"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(o.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},a9e6:function(e,t,n){},b26d:function(e,t,n){"use strict";n.r(t);var a=n("1ef2"),o=n("882a");for(var r in o)["default"].indexOf(r)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(r);n("f037");var u=n("f0c5"),s=Object(u["a"])(o["default"],a["b"],a["c"],!1,null,"453cb730",null,!1,a["a"],void 0);t["default"]=s.exports},f037:function(e,t,n){"use strict";var a=n("a9e6"),o=n.n(a);o.a}},[["a808","common/runtime","common/vendor"]]]);