(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["brick-uni-module-member-oauth_bind"],{"00d1":function(a,t,i){var n=i("da62");"string"===typeof n&&(n=[[a.i,n,""]]),n.locals&&(a.exports=n.locals);var e=i("4f06").default;e("53831cd0",n,!0,{sourceMap:!1,shadowMode:!1})},"1c4b":function(a,t,i){"use strict";i.r(t);var n=i("b589"),e=i.n(n);for(var o in n)["default"].indexOf(o)<0&&function(a){i.d(t,a,(function(){return n[a]}))}(o);t["default"]=e.a},"442a":function(a,t,i){"use strict";var n=i("00d1"),e=i.n(n);e.a},4638:function(a,t,i){"use strict";i.d(t,"b",(function(){return e})),i.d(t,"c",(function(){return o})),i.d(t,"a",(function(){return n}));var n={pageMeta:i("6d42").default},e=function(){var a=this,t=a.$createElement,i=a._self._c||t;return i("v-uni-view",[i("page-meta",{attrs:{"root-font-size":"20px"}}),i("v-uni-view",{staticClass:"pb-page-form"},[i("Logo"),a.base.config.registerDisable?a._e():i("v-uni-view",{staticClass:"nav"},[i("smart-link",{staticClass:"active",attrs:{to:"/brick-uni/module/member/login"}},[a._v("授权登录")])],1),i("v-uni-form",[i("v-uni-view",{staticClass:"margin-top ub-text-center"},[i("v-uni-view",{staticClass:"cu-avatar xl avatar-preview",style:{"background-image":"url("+a.data.avatar+")"}})],1),i("v-uni-view",{staticClass:"cu-form-group margin-top"},[i("v-uni-view",{staticClass:"title"},[i("v-uni-text",{staticClass:"iconfont"},[a._v("")]),a._v("用户名")],1),i("v-uni-input",{attrs:{placeholder:"输入用户名"},model:{value:a.data.username,callback:function(t){a.$set(a.data,"username",t)},expression:"data.username"}})],1),i("v-uni-view",{staticClass:"submit"},[i("v-uni-button",{staticClass:"btn btn-lg btn-primary btn-block",attrs:{loading:a.isSubmitting},on:{click:function(t){arguments[0]=t=a.$handleEvent(t),a.doSubmit()}}},[a._v("确定绑定")])],1)],1)],1)],1)},o=[]},b589:function(a,t,i){"use strict";var n=i("4ea4").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i("0cd4"),o=(i("358c"),n(i("632f"))),r=n(i("ec4f")),u=n(i("1560")),s=n(i("aacc")),c=i("c5ea"),d={components:{Retrieve:s.default,Oauth:u.default,Logo:r.default,StartCaptcha:o.default},mixins:[c.StoreMixin],data:function(){return{isSubmitting:!1,data:{type:"",avatar:"/asset/image/avatar.png",username:""}}},onShow:function(){var a=this;this.$starter.boot((function(){a.data.type=a.$storage.get("oauthLoginType"),a.doOauthCallback()}))},methods:{doOauthCallback:function(){var a=this,t=this.$r.parseH5Url(),i=t.param["code"];i||(i=this.$r.getQuery("code")),this.$dialog.loadingOn(),this.$api.post("oauth/callback",{code:i,type:this.data.type,callback:this.$storage.get("oauthLoginCallback")},(function(t){a.$dialog.loadingOff(),t.data.user.avatar&&(a.data.avatar=t.data.user.avatar),a.data.username=t.data.user.username,a.doTryLogin()}),(function(t){return a.$dialog.loadingOff()}))},doTryLogin:function(){var a=this;this.$dialog.loadingOn(),this.$api.post("oauth/try_login",{type:this.data.type},(function(t){a.$dialog.loadingOff(),t.data.memberUserId&&(a.$dialog.tipSuccess("登录成功，正在跳转"),a.isSubmitting=!0,setTimeout((function(){e.EventBus.$emit("UpdateApp",(function(){a.$r.relaunch()}))}),3e3))}),(function(t){return a.$dialog.loadingOff()}))},doSubmit:function(){var a=this;this.isSubmitting=!0,this.$api.post("oauth/bind",this.data,(function(t){e.EventBus.$emit("UpdateApp",(function(){a.$r.relaunch()}))}),(function(t){a.isSubmitting=!1}))}}};t.default=d},da62:function(a,t,i){var n=i("4bad");t=n(!1),t.push([a.i,".pb-page-form .nav[data-v-7d9f3ba4]{text-align:center;padding:%?20?% 0;color:#999}.pb-page-form .nav uni-text[data-v-7d9f3ba4]{display:inline-block;padding:0 %?20?%}.pb-page-form .nav .link[data-v-7d9f3ba4]{color:#999;text-decoration:none;font-size:%?36?%}.pb-page-form .nav .link.active[data-v-7d9f3ba4]{color:#00bc9b}.pb-page-form .cu-form-group[data-v-7d9f3ba4]{margin:10px 20px;border-radius:5px}.pb-page-form .submit[data-v-7d9f3ba4]{margin:10px 20px}",""]),a.exports=t},ea42:function(a,t,i){"use strict";i.r(t);var n=i("4638"),e=i("1c4b");for(var o in e)["default"].indexOf(o)<0&&function(a){i.d(t,a,(function(){return e[a]}))}(o);i("442a");var r,u=i("f0c5"),s=Object(u["a"])(e["default"],n["b"],n["c"],!1,null,"7d9f3ba4",null,!1,n["a"],r);t["default"]=s.exports}}]);