require('./common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages_course/register"],{968:function(n,e,t){"use strict";(function(n,e){var o=t(4);t(26);o(t(25));var r=o(t(969));n.__webpack_require_UNI_MP_PLUGIN__=t,e(r.default)}).call(this,t(1)["default"],t(2)["createPage"])},969:function(n,e,t){"use strict";t.r(e);var o=t(970),r=t(972);for(var i in r)["default"].indexOf(i)<0&&function(n){t.d(e,n,(function(){return r[n]}))}(i);t(974),t(976);var c,s=t(34),u=Object(s["default"])(r["default"],o["render"],o["staticRenderFns"],!1,null,"214714fe",null,!1,o["components"],c);u.options.__file="pages_course/register.vue",e["default"]=u.exports},970:function(n,e,t){"use strict";t.r(e);var o=t(971);t.d(e,"render",(function(){return o["render"]})),t.d(e,"staticRenderFns",(function(){return o["staticRenderFns"]})),t.d(e,"recyclableRender",(function(){return o["recyclableRender"]})),t.d(e,"components",(function(){return o["components"]}))},971:function(n,e,t){"use strict";var o;t.r(e),t.d(e,"render",(function(){return r})),t.d(e,"staticRenderFns",(function(){return c})),t.d(e,"recyclableRender",(function(){return i})),t.d(e,"components",(function(){return o}));var r=function(){var n=this,e=n.$createElement;n._self._c},i=!1,c=[];r._withStripped=!0},972:function(n,e,t){"use strict";t.r(e);var o=t(973),r=t.n(o);for(var i in o)["default"].indexOf(i)<0&&function(n){t.d(e,n,(function(){return o[n]}))}(i);e["default"]=r.a},973:function(n,e,t){"use strict";(function(n){var o=t(4);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=o(t(11)),i=t(36),c=t(913);function s(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),t.push.apply(t,o)}return t}function u(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?s(Object(t),!0).forEach((function(e){(0,r.default)(n,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}var a={data:function(){return{isLogin:!1,isRegister:0,isLoading:!1,urlOption:{},sortLink:""}},computed:u({},(0,i.mapGetters)(["coureLogin"])),watch:{coureLogin:{immediate:!0,handler:function(n){2==n&&this.isLogin&&(console.log("注册AppToken失效，请重新登录"),this.isLogin=!1,this.goLogin())}}},onLoad:function(e){var t=this;this.urlOption=e.link?JSON.parse(decodeURIComponent(e.link)):{},this.sortLink=this.urlOption.link||"",n.$on("usercode",(function(n){n&&t.goLogin(n)}))},beforeDestroy:function(){n.$off("usercode")},onUnload:function(){n.$off("usercode")},methods:{getLink:function(){var e=this;if(this.sortLink){n.showLoading({title:"注册中"}),(0,c.getRealLink)({sortLink:this.sortLink}).then((function(t){n.hideLoading(),200==t.code?t.config&&t.config.userCourseAuthDomain?(n.setStorageSync("weixinOauth",t.config.userCourseAuthDomain),e.utils.isLoginResCourse().then((function(n){e.isLogin=n,e.isLogin?e.getAddCompanyUser():e.goLogin()}),(function(n){}))):n.showToast({title:"授权地址错误",icon:"none"}):n.showToast({title:t.msg,icon:"none"})})).catch((function(e){n.hideLoading(),n.showToast({title:"发生错误，请稍后再试",icon:"none"})}))}else n.showToast({title:"链接错误",icon:"none"})},goLogin:function(e){var t=this;e?this.utils.getProvider().then((function(o){console.log("当前的环境商",o),o||reject(),n.login({provider:o,success:function(r){console.log(r),n.getUserInfo({provider:o,success:function(o){var i={code:r.code,appId:getApp().globalData.appId,userId:e.userId};n.showLoading({title:"注册中"}),(0,c.handleFsUserWx)(i).then((function(e){n.hideLoading(),200==e.code?t.getAddCompanyUser():(n.removeStorageSync("web_userInfo"),n.removeStorageSync("TOKEN_WEXIN"),n.showToast({title:e.msg,icon:"none"}))})).catch((function(e){n.hideLoading()}))}})}})})):(n.setStorageSync("H5course",{companyId:this.urlOption.companyId,companyUserId:this.urlOption.companyUserId}),n.navigateTo({url:"/pages_course/webview"}))},getAddCompanyUser:function(){var e=this;(0,c.isAddCompanyUser)(this.urlOption).then((function(t){200==t.code?e.isRegister=1:n.showToast({title:t.msg,icon:"none"})}))}}};e.default=a}).call(this,t(2)["default"])},974:function(n,e,t){"use strict";t.r(e);var o=t(975),r=t.n(o);for(var i in o)["default"].indexOf(i)<0&&function(n){t.d(e,n,(function(){return o[n]}))}(i);e["default"]=r.a},975:function(n,e,t){},976:function(n,e,t){"use strict";t.r(e);var o=t(977),r=t.n(o);for(var i in o)["default"].indexOf(i)<0&&function(n){t.d(e,n,(function(){return o[n]}))}(i);e["default"]=r.a},977:function(n,e,t){}},[[968,"common/runtime","common/vendor"]]]);
//# sourceMappingURL=../../.sourcemap/mp-weixin/pages_course/register.js.map