(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/public/wxLogin"],{"5c31":function(e,n,t){},6638:function(e,n,t){"use strict";(function(e){t("e27b");o(t("66fd"));var n=o(t("e93f"));function o(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=t,e(n.default)}).call(this,t("543d")["createPage"])},c0d5:function(e,n,t){"use strict";(function(e){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=t("4f00"),c=t("3b8a"),r=t("08dc"),i=t("26cb");function a(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 u(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?a(Object(t),!0).forEach((function(n){s(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function s(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var l={data:function(){return{userInfo:{},code:"",isclick:!1}},onLoad:function(e){this.loadData()},computed:{},methods:u(u({},(0,i.mapMutations)("user",["login","setUserInfo"])),{},{loadData:function(){var e=this;(0,c.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){console.log(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")||"",c=e.getStorageSync("spread_code")||"";(0,r.wechatMpAuth)({code:n.code,iv:t.iv,encryptedData:t.encryptedData,spread_spid:o,spread_code:c}).then((function(e){var t=e.data;n.wchatAuth(t),console.log(t,"wechatMpAuth++++++++++++++++++++++++++")})).catch((function(e){console.log(e)}))},wchatAuth:function(n){var t=this;e.setStorageSync("token",n.token),console.log(n.token,"token++++++++++++++"),(0,o.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("543d")["default"])},c652:function(e,n,t){"use strict";var o=t("5c31"),c=t.n(o);c.a},e1bd:function(e,n,t){"use strict";var o;t.d(n,"b",(function(){return c})),t.d(n,"c",(function(){return r})),t.d(n,"a",(function(){return o}));var c=function(){var e=this,n=e.$createElement;e._self._c;e._isMounted||(e.e0=function(n){!e.isclick&&e.userInfoData()})},r=[]},e93f:function(e,n,t){"use strict";t.r(n);var o=t("e1bd"),c=t("ecea");for(var r in c)"default"!==r&&function(e){t.d(n,e,(function(){return c[e]}))}(r);t("c652");var i,a=t("f0c5"),u=Object(a["a"])(c["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],i);n["default"]=u.exports},ecea:function(e,n,t){"use strict";t.r(n);var o=t("c0d5"),c=t.n(o);for(var r in o)"default"!==r&&function(e){t.d(n,e,(function(){return o[e]}))}(r);n["default"]=c.a}},[["6638","common/runtime","common/vendor"]]]);