!(function () { var e = ['returnUrl', 'isRegister'] function n(e, n, t, r, o, i, a) { try { var u = e[i](a), s = u.value } catch (l) { return void t(l) } u.done ? n(s) : Promise.resolve(s).then(r, o) } function t(e) { return function () { var t = this, r = arguments return new Promise(function (o, i) { var a = e.apply(t, r) function u(e) { n(a, o, i, u, s, 'next', e) } function s(e) { n(a, o, i, u, s, 'throw', e) } u(void 0) }) } } function r(e, n) { var t = Object.keys(e) if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(e) n && (r = r.filter(function (n) { return Object.getOwnPropertyDescriptor(e, n).enumerable })), t.push.apply(t, r) } return t } function o(e) { for (var n = 1; n < arguments.length; n++) { var t = null != arguments[n] ? arguments[n] : {} n % 2 ? r(Object(t), !0).forEach(function (n) { i(e, n, t[n]) }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : r(Object(t)).forEach(function (n) { Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n)) }) } return e } function i(e, n, t) { return ( n in e ? Object.defineProperty(e, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : (e[n] = t), e ) } function a(e, n) { if (null == e) return {} var t, r, o = (function (e, n) { if (null == e) return {} var t, r, o = {}, i = Object.keys(e) for (r = 0; r < i.length; r++) (t = i[r]), n.indexOf(t) >= 0 || (o[t] = e[t]) return o })(e, n) if (Object.getOwnPropertySymbols) { var i = Object.getOwnPropertySymbols(e) for (r = 0; r < i.length; r++) (t = i[r]), n.indexOf(t) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, t) && (o[t] = e[t])) } return o } var u = document.createElement('style') ;(u.innerHTML = '._login_y7mb5_1{min-height:100vh;background:url(./assets/top_bg.3e7f9908.png) no-repeat top center;background-color:#fff;background-size:100%}._login_y7mb5_1 ._loginTitle_y7mb5_7{padding-top:2.66667rem;font-size:.69333rem;padding-left:.93333rem;padding-bottom:1.86667rem;line-height:.98667rem;font-weight:500}._login_y7mb5_1 ._codeText_y7mb5_15{color:var(--van-primary-text)}._login_y7mb5_1 ._margin34_y7mb5_18{margin:0 .90667rem}._login_y7mb5_1 ._formTitle_y7mb5_21{font-size:.48rem;color:#000;font-weight:500}._login_y7mb5_1 .van-cell-group{margin-bottom:.93333rem}._login_y7mb5_1 .van-field{padding-left:0;padding-right:0}._login_y7mb5_1 .van-button+.van-button{margin-top:.53333rem;color:#000!important}\n'), document.head.appendChild(u), System.register( [ './validate-legacy.1c2c1454.js', './index-legacy.2ae28dc5.js', './index-legacy.26638f55.js', './index-legacy.c82098ab.js', './index-legacy.261ae52e.js', './index-legacy.d61b8a1f.js', './index-legacy.51e5b886.js' ], function (n) { 'use strict' var r, i, u, s, l, c, d, f, p, m, g, y, h, b, _, v, S return { setters: [ function (e) { ;(r = e.c), (i = e.R), (u = e.C), (s = e.I) }, function (e) { ;(l = e.d), (c = e.s), (d = e.f), (f = e.g), (p = e.h), (m = e.i), (g = e.j), (y = e.k), (h = e.l), (b = e.B) }, function (e) { _ = e.C }, function (e) { v = e.C }, function (e) { S = e.F }, function () {}, function () {} ], execute: function () { var w = '_login_y7mb5_1', O = '_loginTitle_y7mb5_7', C = '_codeText_y7mb5_15', T = '_margin34_y7mb5_18', x = '_formTitle_y7mb5_21' n( 'default', l({ name: 'login', data: function () { return { loginType: 'SMS', username: '', password: '', smsCode: '', countDownStatus: !0, countDownTime: 12e4, imgCodeStatus: !1 } }, computed: { codeDisable: function () { var e = !0 return ( 'PWD' === this.loginType ? this.username && this.password && (e = !1) : this.username && this.smsCode && (e = !1), e ) }, appName: function () { return { STUDENT: '学生端', TEACHER: '老师端', SCHOOL: '管理端' }[ c.platformType ] } }, mounted: function () { d(), this.directNext() }, methods: { directNext: function () { if ('login' === c.user.status || 'error' === c.user.status) { var n = this.$route.query, t = n.returnUrl, r = (n.isRegister, a(n, e)) this.$router.replace({ path: t, query: o({}, r) }) } }, onLogin: function () { var e = this return t( regeneratorRuntime.mark(function n() { var t, r, i, a, u return regeneratorRuntime.wrap( function (n) { for (;;) switch ((n.prev = n.next)) { case 0: return ( (n.prev = 0), (t = { username: e.username, client_id: c.clientId[c.platformType], client_secret: c.clientId[c.platformType] }), 'PWD' === e.loginType ? ((t.password = e.password), (t.loginType = 'PASSWORD'), (t.grant_type = 'PASSWORD')) : ((t.password = e.smsCode), (t.loginType = 'SMS'), (t.grant_type = 'SMS')), (n.next = 5), f.post('/api-oauth/userlogin', { requestType: 'form', data: o({}, t) }) ) case 5: return ( (r = n.sent), (i = r.data), p(i.token_type + ' ' + i.access_token), (n.next = 10), f.get(c.platformApi + '/user/getUserInfo', { initRequest: !0 }) ) case 10: ;(a = n.sent), 'SCHOOL' === c.platformType && ((u = a.data.schoolInfos ? a.data.schoolInfos[0] : {}), (a.data.school = u)), m(a.data), e.directNext(), (n.next = 18) break case 16: ;(n.prev = 16), (n.t0 = n.catch(0)) case 18: case 'end': return n.stop() } }, n, null, [[0, 16]] ) }) )() }, onSendCode: function () { var e = this return t( regeneratorRuntime.mark(function n() { return regeneratorRuntime.wrap(function (n) { for (;;) switch ((n.prev = n.next)) { case 0: if (r(e.username)) { n.next = 2 break } return n.abrupt('return', g('请输入正确的手机号码')) case 2: e.imgCodeStatus = !0 case 3: case 'end': return n.stop() } }, n) }) )() }, onCodeSend: function () { var e = this ;(this.countDownStatus = !1), this.$nextTick(function () { e.$refs.countDownRef.start() }) }, onFinished: function () { ;(this.countDownStatus = !0), this.$refs.countDownRef.reset() }, onChange: function () { 'PWD' === this.loginType ? (this.loginType = 'SMS') : 'SMS' === this.loginType && (this.loginType = 'PWD') } }, render: function () { var e = this return y('div', { class: w }, [ y('div', { class: O }, [ h('您好,'), y('br', null, null), h(' 欢迎使用管乐团'), this.appName ]), y( _, { class: T, border: !1 }, { default: function () { return [ y( i, { style: { marginBottom: '16px' } }, { default: function () { return [ y( u, { span: 24, class: x }, { default: function () { return [h('手机号')] } } ), y( u, { span: 24, class: 'van-hairline--bottom' }, { default: function () { return [ y( S, { modelValue: e.username, 'onUpdate:modelValue': function (n) { return (e.username = n) }, name: '手机号', placeholder: '请输入您的手机号', type: 'tel', maxlength: 11 }, null ) ] } } ) ] } } ), 'PWD' === e.loginType ? y(i, null, { default: function () { return [ y( u, { span: 24, class: x }, { default: function () { return [h('密码')] } } ), y( u, { span: 24, class: 'van-hairline--bottom' }, { default: function () { return [ y( S, { modelValue: e.password, 'onUpdate:modelValue': function (n) { return (e.password = n) }, type: 'password', name: '密码', placeholder: '请输入密码' }, null ) ] } } ) ] } }) : y(i, null, { default: function () { return [ y( u, { span: 24, class: x }, { default: function () { return [h('验证码')] } } ), y( u, { span: 24, class: 'van-hairline--bottom' }, { default: function () { return [ y( S, { modelValue: e.smsCode, 'onUpdate:modelValue': function (n) { return (e.smsCode = n) }, name: '验证码', placeholder: '请输入验证码', type: 'tel', maxlength: 6 }, { button: function () { return e.countDownStatus ? y( 'span', { class: C, onClick: e.onSendCode }, [h('获取验证码')] ) : y( v, { ref: 'countDownRef', 'auto-start': !1, time: e.countDownTime, onFinish: e.onFinished, format: 'ss秒' }, null ) } } ) ] } } ) ] } }) ] } } ), y('div', { class: T }, [ y( b, { round: !0, block: !0, type: 'primary', disabled: this.codeDisable, onClick: this.onLogin }, { default: function () { return [h('提交')] } } ), y( b, { block: !0, round: !0, color: '#F5F7FB', onClick: this.onChange }, { default: function () { return ['PWD' === e.loginType ? '验证码登录' : '密码登录'] } } ) ]), this.imgCodeStatus ? y( s, { value: this.imgCodeStatus, 'onUpdate:value': function (n) { return (e.imgCodeStatus = n) }, phone: this.username, onClose: function () { e.imgCodeStatus = !1 }, onSendCode: this.onCodeSend }, null ) : null ]) } }) ) } } } ) })()