login.js 4.0 KB

12
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/auth/login"],{209:function(e,n,t){"use strict";(function(e,n){var o=t(4);t(26);o(t(25));var r=o(t(210));e.__webpack_require_UNI_MP_PLUGIN__=t,n(r.default)}).call(this,t(1)["default"],t(2)["createPage"])},210:function(e,n,t){"use strict";t.r(n);var o=t(211),r=t(213);for(var i in r)["default"].indexOf(i)<0&&function(e){t.d(n,e,(function(){return r[e]}))}(i);t(215);var u,a=t(34),s=Object(a["default"])(r["default"],o["render"],o["staticRenderFns"],!1,null,null,null,!1,o["components"],u);s.options.__file="pages/auth/login.vue",n["default"]=s.exports},211:function(e,n,t){"use strict";t.r(n);var o=t(212);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"]}))},212:function(e,n,t){"use strict";var o;t.r(n),t.d(n,"render",(function(){return r})),t.d(n,"staticRenderFns",(function(){return u})),t.d(n,"recyclableRender",(function(){return i})),t.d(n,"components",(function(){return o}));var r=function(){var e=this,n=e.$createElement;e._self._c},i=!1,u=[];r._withStripped=!0},213:function(e,n,t){"use strict";t.r(n);var o=t(214),r=t.n(o);for(var i in o)["default"].indexOf(i)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(i);n["default"]=r.a},214:function(e,n,t){"use strict";(function(e){var o=t(4);Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(t(57)),i=o(t(59)),u=t(169),a={data:function(){return{wxShow:!1,isAgreement:!1,code:null}},computed:{imgPath:function(){return this.$store.state.imgpath},appid:function(){return this.$store.state.appid},imgname:function(){return this.$store.state.logoname}},onLoad:function(n){e.$on("refreshLogin",(function(){var n=getCurrentPages();n.length>1?e.navigateBack({delta:1}):(e.reLaunch({url:"/pages/index/index"}),e.showToast({title:"已经是首页了",icon:"none"}))}))},onUnload:function(){},mounted:function(){},methods:{gologin:function(){var n=this;e.showLoading({title:"处理中"}),e.login({provider:"weixin",success:function(){var t=(0,i.default)(r.default.mark((function t(o){var i,a;return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:console.log(o),i=o.code,a=e.getStorageSync("tuiUserId"),(0,u.loginByMp)({code:i,tuiUserId:a}).then((function(t){e.hideLoading(),200==t.code?(e.showToast({icon:"none",title:"登录成功"}),e.setStorageSync("userHistoryApp",t.user.historyApp),e.setStorageSync("AppToken",t.token),e.setStorageSync("userId",t.user.userId),e.setStorageSync("avatar",t.user.avatar),e.setStorageSync("nickName",t.user.nickName),0==t.user.isWeixinAuth?n.wxAuthOpen():(e.$emit("refreshLogin"),e.$emit("refreshIM"))):e.showToast({icon:"none",title:"授权登录失败,请重新登录"})})).catch((function(n){console.log(n),e.hideLoading(),e.showToast({icon:"none",title:"授权登录失败,请重新登录"})}));case 4:case"end":return t.stop()}}),t)})));function o(e){return t.apply(this,arguments)}return o}()})},updateUser:function(){this.wxShow=!1,e.$emit("refreshLogin"),e.$emit("refreshIM")},wxAuthOpen:function(){this.wxShow=!0;var e=this;setTimeout((function(){e.$refs.wxauth.getUserInfo()}))},wxAuthClose:function(){this.wxShow=!1},handleAgree:function(){this.isAgreement?this.gologin():e.showToast({icon:"none",title:"请先同意协议后再登录"})},openContent:function(n){console.log(n),e.navigateTo({url:"/pages_user/agreement?type="+n})},handleAgreement:function(){this.isAgreement=!this.isAgreement},phoneLogin:function(n){e.showLoading({title:"处理中"}),console.log(n)},back:function(){e.navigateBack({delta:1})}}};n.default=a}).call(this,t(2)["default"])},215:function(e,n,t){"use strict";t.r(n);var o=t(216),r=t.n(o);for(var i in o)["default"].indexOf(i)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(i);n["default"]=r.a},216:function(e,n,t){}},[[209,"common/runtime","common/vendor"]]]);
  2. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/auth/login.js.map