(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/set/userinfo"],{1759:function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){}));var o=function(){var t=this.$createElement;this._self._c},a=[]},"3e1b":function(t,e,n){"use strict";(function(t,e){var o=n("4ea4");n("ab68");o(n("66fd"));var a=o(n("b94d"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(a.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},"437a":function(t,e,n){},"6c19":function(t,e,n){"use strict";(function(t){var o=n("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=o(n("9523")),r=n("26cb"),i=n("3a14"),c=n("1418");n("0b16"),n("f654");function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){(0,a.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var f={data:function(){return{show:!1,password:""}},onLoad:function(){console.log(this.baseURL)},computed:u(u({},(0,r.mapState)("user",["userInfo"])),(0,r.mapState)(["baseURL"])),methods:u(u({},(0,r.mapMutations)("user",["logout"])),{},{imgsub:function(){var t=this;console.log("上传头像"),(0,i.upload)({filename:""}).then((function(e){console.log("data",e),t.userInfo.avatar=e[0].url}))},uploadImage:function(e){var n=this;console.log(this.baseURL+"/api/upload/image","url"),t.uploadFile({url:this.baseURL+"/api/upload/image",filePath:e,name:"file",header:{"Authori-zation":"Bearer "+t.getStorageSync("token")},success:function(t){var e;e="string"===typeof t.data?JSON.parse(t.data).data:t.data.data,console.log(e),n.userInfo.avatar=e.url},fail:function(t){console.log(t,"err")}})},confirm:function(){var e=this;if("微信用户"==this.userInfo.nickname)return this.$api.msg("请修改昵称");(0,c.userEdit)({avatar:this.userInfo.avatar,nickname:this.userInfo.nickname}).then((function(n){e.$api.msg("修改成功"),setTimeout((function(){t.switchTab({url:"/pages/user/user"})}),1e3),console.log(n)})).catch((function(t){console.log(t)}))},toLogout:function(){var e=this;t.showModal({content:"确定要退出登录么",success:function(n){n.confirm&&((0,c.logout)({}).then((function(e){t.navigateBack()})).catch((function(t){console.log(t)})),e.logout())}})},test:function(t){console.log(t.detail,"123456")},onChooseAvatar:function(t){this.uploadImage(t.detail.avatarUrl)},cancel:function(){var e=this;t.showModal({content:"确定要退出登录么",success:function(n){n.confirm&&(0,c.logout)({}).then((function(n){e.logout(),t.switchTab({url:"/pages/index/index"})})).catch((function(t){console.log(t)}))}})},qx:function(){this.password="",this.$refs.popup.close()},pswQd:function(){if(this.password!=this.userInfo.phone)return this.$refs.popup.close(),this.password="",void this.$api.msg("请输入自己的账户");this.$refs.popup.close(),this.password="",this.$api.msg("申请注销成功，请耐心等待审核")}})};e.default=f}).call(this,n("543d")["default"])},b94d:function(t,e,n){"use strict";n.r(e);var o=n("1759"),a=n("fcbd");for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n("e1c3");var i=n("f0c5"),c=Object(i["a"])(a["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);e["default"]=c.exports},e1c3:function(t,e,n){"use strict";var o=n("437a"),a=n.n(o);a.a},fcbd:function(t,e,n){"use strict";n.r(e);var o=n("6c19"),a=n.n(o);for(var r in o)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(r);e["default"]=a.a}},[["3e1b","common/runtime","common/vendor"]]]);