(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/public/wxLogin"],{"0568":function(e,t,n){"use strict";n.r(t);var o=n("4961"),c=n("54bb");for(var a in c)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return c[e]}))}(a);n("eaf6");var i=n("f0c5"),r=Object(i["a"])(c["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);t["default"]=r.exports},"0c85":function(e,t,n){"use strict";(function(e,o){var c=n("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=c(n("9523")),i=n("5b71"),r=n("89f3"),u=n("8116"),s=n("26cb");function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var d={data:function(){return{userInfo:{},code:"",isclick:!1,logo:""}},onLoad:function(e){this.loadData(),this.getlogo()},computed:{},methods:f(f({},(0,s.mapMutations)("user",["login","setUserInfo"])),{},{getlogo:function(){var e=this;(0,u.get_logo)({}).then((function(t){var n=t.data;e.logo=n.logo_url,console.log(n,"000000")}))},loadData:function(){var t=this;(0,r.loginWinxinMp)().then((function(){e.login({success:function(e){console.log(e,"loginWinxinMp"),t.code=e.code},fill:function(e){console.log(e)}})}))},userInfoData:function(){var t=this;t.isclick||(t.isclick=!0,e.getUserProfile({desc:"用于完善会员资料",success:function(e){console.log(e,"that.userInfo+++++++++++++++++++"),t.userInfo=e,o.showLoading({title:"授权中",mask:!0}),t.loadMp()},fail:function(e){t.isclick=!1,o.showToast({title:"您拒绝了请求,不能正常使用小程序",icon:"error",duration:2e3})}}))},loadMp:function(){var e=this,t=e.userInfo;console.log(t);var n=o.getStorageSync("spread")||"",c=o.getStorageSync("puid")||"";(0,u.wechatMpAuth)({code:e.code,iv:t.iv,encryptedData:t.encryptedData,spread_spid:n,spread_code:c}).then((function(t){var n=t.data;e.wchatAuth(n),console.log(n,"wechatMpAuth++++++++++++++++++++++++++")})).catch((function(e){}))},wchatAuth:function(e){var t=this;o.setStorageSync("token",e.token),console.log(e.token,"token++++++++++++++"),(0,i.getUserInfo)({}).then((function(e){console.log("userInfo+++++++++++",e),t.login(),o.hideLoading(),t.setUserInfo(e.data);var n=o.getStorageSync("present")||"/pages/index/index";"pages/shop/product"==n&&(n="/pages/index/index"),o.setStorageSync("jynickname",1),o.switchTab({url:n,fail:function(e){o.navigateTo({url:n,fail:function(e){o.navigateTo({url:"/pages/index/index"})}})}})}))}})};t.default=d}).call(this,n("bc2e")["default"],n("543d")["default"])},4961:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return c})),n.d(t,"a",(function(){}));var o=function(){var e=this,t=e.$createElement;e._self._c;e._isMounted||(e.e0=function(t){!e.isclick&&e.userInfoData()})},c=[]},"54bb":function(e,t,n){"use strict";n.r(t);var o=n("0c85"),c=n.n(o);for(var a in o)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(a);t["default"]=c.a},"8a78":function(e,t,n){},a945:function(e,t,n){"use strict";(function(e,t){var o=n("4ea4");n("12d5");o(n("66fd"));var c=o(n("0568"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(c.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},eaf6:function(e,t,n){"use strict";var o=n("8a78"),c=n.n(o);c.a}},[["a945","common/runtime","common/vendor"]]]);