auth-login-legacy.4d775b67.js 3.9 KB

1
  1. !function(){function e(e,n,t,o,r,s,a){try{var c=e[s](a),i=c.value}catch(u){return void t(u)}c.done?n(i):Promise.resolve(i).then(o,r)}function n(n){return function(){var t=this,o=arguments;return new Promise((function(r,s){var a=n.apply(t,o);function c(n){e(a,r,s,c,i,"next",n)}function i(n){e(a,r,s,c,i,"throw",n)}c(void 0)}))}}System.register(["./index-legacy.fba2875c.js","./index-legacy.d92f7da7.js","./index-legacy.ec32ced6.js","./logo-legacy.cf4b3bd2.js","./auth-legacy.0b00e81c.js","./routes-common-legacy.6845df4a.js"],(function(e){"use strict";var t,o,r,s,a,c,i,u,f,h,p,l,d,m,g,v,k;return{setters:[function(e){t=e.d,o=e.g,r=e.b0,s=e.bq,a=e.n,c=e.T,i=e.p,u=e.i,f=e.j,h=e.z,p=e.B},function(e){l=e.I},function(e){d=e.r,m=e.a,g=e.s,v=e.b},function(e){k=e.l},function(){},function(){}],execute:function(){e("default",t({name:"login-music",data:function(){return{username:"",imgCodeStatus:!1}},mounted:function(){var e=this;this.username=o.orchestraInfo.phone,d(),r("webViewOnResume",(function(){i({api:"getUserAccount"}).then(function(){var t=n(regeneratorRuntime.mark((function n(t){var r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=t.content,o.orchestraInfo.token=r.token.split(" ")[1],o.orchestraInfo.phone=r.phone,o.orchestraInfo.nickname=r.nickname,o.orchestraInfo.avatar=r.avatar,o.orchestraInfo.unionId=r.unionId||0,e.username=o.orchestraInfo.phone,r.unionId&&"/home-auth"===e.$route.path&&e.getUserInfo();case 8:case"end":return n.stop()}}),n)})));return function(e){return t.apply(this,arguments)}}())}))},unmounted:function(){s("webViewOnResume",(function(){}))},methods:{onLoginSuccess:function(){var e=this;a({api:"bindUserAccount",content:{phone:this.username}}),setTimeout((function(){c("授权成功")}),100),setTimeout((function(){e.getUserInfo()}),1e3)},getUserInfo:function(){var e=this;return n(regeneratorRuntime.mark((function n(){var t,r,s;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,m.post("/api-auth/smsLogin",{requestType:"form",data:{clientId:"student",clientSecret:"student",phone:o.orchestraInfo.phone,token:o.orchestraInfo.token,isSurportRegister:!0}});case 3:return t=n.sent,r=t.data.authentication,g(r.token_type+" "+r.access_token),i({api:"setCache",content:{key:"h5-colexiu-token",value:r.token_type+" "+r.access_token}}),n.next=9,m.get("/api-student/student/queryUserInfo",{initRequest:!0});case 9:s=n.sent,u(s.data),e.$router.push("/home"),n.next=16;break;case 14:n.prev=14,n.t0=n.catch(0);case 16:case"end":return n.stop()}}),n,null,[[0,14]])})))()},onLogin:function(){var e=this;return n(regeneratorRuntime.mark((function n(){var t,r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,m.post("/api-auth/smsLogin",{requestType:"form",data:{clientId:"student",clientSecret:"student",phone:e.username,token:o.orchestraInfo.token,isSurportRegister:!0}});case 3:t=n.sent,r=t.data.authentication,g(r.token_type+" "+r.access_token),i({api:"setCache",content:{key:"h5-colexiu-token",value:r.token_type+" "+r.access_token}}),e.onLoginSuccess(),n.next=12;break;case 10:n.prev=10,n.t0=n.catch(0);case 12:case"end":return n.stop()}}),n,null,[[0,10]])})))()}},render:function(){var e=this;return f("div",{class:v.login},[f("div",{class:v.container},[f("div",{class:[v.userInfo,v.loginCenter]},[f(l,{src:o.orchestraInfo.avatar||"./assets/icon-student-default.0e847d86.png",class:v.img,fit:"cover"},null),f("p",{class:v.name},[o.orchestraInfo.name])]),f("div",{class:[v.tips,v.loginCenter]},[f(l,{src:k,class:v.logo,fit:"contain"},null),f("p",{class:v.text},[h("同意酷乐秀获取您的管乐团信息并登录")]),f("p",{class:v.phone},[this.username])])]),f("div",{class:v.btnGroup},[f(p,{round:!0,color:"#FF8057",class:v.btn,onClick:this.onLogin},{default:function(){return[h("授权登录")]}}),f("span",{class:v.moreBtn,onClick:function(){e.$router.push("/home-login")}},[h("其他手机号登录")])])])}}))}}}))}();