(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/public/wxLogin"],{63:function(e,n,t){"use strict";(function(e){var n=t(3);t(25);n(t(24));var o=n(t(64));wx.__webpack_require_UNI_MP_PLUGIN__=t,e(o.default)}).call(this,t(1)["createPage"])},64:function(e,n,t){"use strict";t.r(n);var o=t(65),r=t(67);for(var c in r)["default"].indexOf(c)<0&&function(e){t.d(n,e,(function(){return r[e]}))}(c);t(72);var i,a=t(39),u=Object(a["default"])(r["default"],o["render"],o["staticRenderFns"],!1,null,null,null,!1,o["components"],i);u.options.__file="pages/public/wxLogin.vue",n["default"]=u.exports},65:function(e,n,t){"use strict";t.r(n);var o=t(66);t.d(n,"render",(function(){return o["render"]})),t.d(n,"staticRenderFns",(function(){return o["staticRenderFns"]})),t.d(n,"recyclableRender",(function(){return o["recyclableRender"]})),t.d(n,"components",(function(){return o["components"]}))},66:function(e,n,t){"use strict";var o;t.r(n),t.d(n,"render",(function(){return r})),t.d(n,"staticRenderFns",(function(){return i})),t.d(n,"recyclableRender",(function(){return c})),t.d(n,"components",(function(){return o}));var r=function(){var e=this,n=e.$createElement;e._self._c;e._isMounted||(e.e0=function(n){!e.isclick&&e.userInfoData()})},c=!1,i=[];r._withStripped=!0},67:function(e,n,t){"use strict";t.r(n);var o=t(68),r=t.n(o);for(var c in o)["default"].indexOf(c)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(c);n["default"]=r.a},68:function(e,n,t){"use strict";(function(e){var o=t(3);Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(t(10)),c=t(69),i=t(70),a=t(71),u=t(27);function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function f(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?s(Object(t),!0).forEach((function(n){(0,r.default)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var l={data:function(){return{userInfo:{},code:"",isclick:!1}},onLoad:function(e){this.loadData()},computed:{},methods:f(f({},(0,u.mapMutations)("user",["login","setUserInfo"])),{},{loadData:function(){var e=this;(0,i.loginWinxinMp)().then((function(){wx.login({success:function(n){console.log(n,"loginWinxinMp"),e.code=n.code},fill:function(e){console.log(e)}})}))},userInfoData:function(){var n=this;n.isclick||(n.isclick=!0,wx.getUserProfile({desc:"用于完善会员资料",success:function(t){console.log(t,"that.userInfo+++++++++++++++++++"),n.userInfo=t,e.showLoading({title:"授权中",mask:!0}),n.loadMp()},fail:function(t){n.isclick=!1,e.showToast({title:"您拒绝了请求,不能正常使用小程序",icon:"error",duration:2e3})}}))},loadMp:function(){var n=this,t=n.userInfo;console.log(t);var o=e.getStorageSync("spread")||"",r=e.getStorageSync("spread_code")||"";(0,a.wechatMpAuth)({code:n.code,iv:t.iv,encryptedData:t.encryptedData,spread_spid:o,spread_code:r}).then((function(e){var t=e.data;n.wchatAuth(t),console.log(t,"wechatMpAuth++++++++++++++++++++++++++")})).catch((function(e){}))},wchatAuth:function(n){var t=this;e.setStorageSync("token",n.token),console.log(n.token,"token++++++++++++++"),(0,c.getUserInfo)({}).then((function(n){console.log("userInfo+++++++++++",n),t.login(),e.hideLoading(),t.setUserInfo(n.data);var o=e.getStorageSync("present")||"/pages/index/index";"pages/shop/product"==o&&(o="/pages/index/index"),e.switchTab({url:o,fail:function(n){e.navigateTo({url:o,fail:function(n){e.navigateTo({url:"/pages/index/index"})}})}})}))}})};n.default=l}).call(this,t(1)["default"])},72:function(e,n,t){"use strict";t.r(n);var o=t(73),r=t.n(o);for(var c in o)["default"].indexOf(c)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(c);n["default"]=r.a},73:function(e,n,t){}},[[63,"common/runtime","common/vendor"]]]);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/public/wxLogin.js.map