login-legacy.279a4f4f.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. !(function () {
  2. var e = ['returnUrl', 'isRegister']
  3. function n(e, n, t, r, o, i, a) {
  4. try {
  5. var u = e[i](a),
  6. s = u.value
  7. } catch (l) {
  8. return void t(l)
  9. }
  10. u.done ? n(s) : Promise.resolve(s).then(r, o)
  11. }
  12. function t(e) {
  13. return function () {
  14. var t = this,
  15. r = arguments
  16. return new Promise(function (o, i) {
  17. var a = e.apply(t, r)
  18. function u(e) {
  19. n(a, o, i, u, s, 'next', e)
  20. }
  21. function s(e) {
  22. n(a, o, i, u, s, 'throw', e)
  23. }
  24. u(void 0)
  25. })
  26. }
  27. }
  28. function r(e, n) {
  29. var t = Object.keys(e)
  30. if (Object.getOwnPropertySymbols) {
  31. var r = Object.getOwnPropertySymbols(e)
  32. n &&
  33. (r = r.filter(function (n) {
  34. return Object.getOwnPropertyDescriptor(e, n).enumerable
  35. })),
  36. t.push.apply(t, r)
  37. }
  38. return t
  39. }
  40. function o(e) {
  41. for (var n = 1; n < arguments.length; n++) {
  42. var t = null != arguments[n] ? arguments[n] : {}
  43. n % 2
  44. ? r(Object(t), !0).forEach(function (n) {
  45. i(e, n, t[n])
  46. })
  47. : Object.getOwnPropertyDescriptors
  48. ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t))
  49. : r(Object(t)).forEach(function (n) {
  50. Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n))
  51. })
  52. }
  53. return e
  54. }
  55. function i(e, n, t) {
  56. return (
  57. n in e
  58. ? Object.defineProperty(e, n, { value: t, enumerable: !0, configurable: !0, writable: !0 })
  59. : (e[n] = t),
  60. e
  61. )
  62. }
  63. function a(e, n) {
  64. if (null == e) return {}
  65. var t,
  66. r,
  67. o = (function (e, n) {
  68. if (null == e) return {}
  69. var t,
  70. r,
  71. o = {},
  72. i = Object.keys(e)
  73. for (r = 0; r < i.length; r++) (t = i[r]), n.indexOf(t) >= 0 || (o[t] = e[t])
  74. return o
  75. })(e, n)
  76. if (Object.getOwnPropertySymbols) {
  77. var i = Object.getOwnPropertySymbols(e)
  78. for (r = 0; r < i.length; r++)
  79. (t = i[r]),
  80. n.indexOf(t) >= 0 || (Object.prototype.propertyIsEnumerable.call(e, t) && (o[t] = e[t]))
  81. }
  82. return o
  83. }
  84. var u = document.createElement('style')
  85. ;(u.innerHTML =
  86. '._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'),
  87. document.head.appendChild(u),
  88. System.register(
  89. [
  90. './validate-legacy.1c2c1454.js',
  91. './index-legacy.2ae28dc5.js',
  92. './index-legacy.26638f55.js',
  93. './index-legacy.c82098ab.js',
  94. './index-legacy.261ae52e.js',
  95. './index-legacy.d61b8a1f.js',
  96. './index-legacy.51e5b886.js'
  97. ],
  98. function (n) {
  99. 'use strict'
  100. var r, i, u, s, l, c, d, f, p, m, g, y, h, b, _, v, S
  101. return {
  102. setters: [
  103. function (e) {
  104. ;(r = e.c), (i = e.R), (u = e.C), (s = e.I)
  105. },
  106. function (e) {
  107. ;(l = e.d),
  108. (c = e.s),
  109. (d = e.f),
  110. (f = e.g),
  111. (p = e.h),
  112. (m = e.i),
  113. (g = e.j),
  114. (y = e.k),
  115. (h = e.l),
  116. (b = e.B)
  117. },
  118. function (e) {
  119. _ = e.C
  120. },
  121. function (e) {
  122. v = e.C
  123. },
  124. function (e) {
  125. S = e.F
  126. },
  127. function () {},
  128. function () {}
  129. ],
  130. execute: function () {
  131. var w = '_login_y7mb5_1',
  132. O = '_loginTitle_y7mb5_7',
  133. C = '_codeText_y7mb5_15',
  134. T = '_margin34_y7mb5_18',
  135. x = '_formTitle_y7mb5_21'
  136. n(
  137. 'default',
  138. l({
  139. name: 'login',
  140. data: function () {
  141. return {
  142. loginType: 'SMS',
  143. username: '',
  144. password: '',
  145. smsCode: '',
  146. countDownStatus: !0,
  147. countDownTime: 12e4,
  148. imgCodeStatus: !1
  149. }
  150. },
  151. computed: {
  152. codeDisable: function () {
  153. var e = !0
  154. return (
  155. 'PWD' === this.loginType
  156. ? this.username && this.password && (e = !1)
  157. : this.username && this.smsCode && (e = !1),
  158. e
  159. )
  160. },
  161. appName: function () {
  162. return { STUDENT: '学生端', TEACHER: '老师端', SCHOOL: '管理端' }[
  163. c.platformType
  164. ]
  165. }
  166. },
  167. mounted: function () {
  168. d(), this.directNext()
  169. },
  170. methods: {
  171. directNext: function () {
  172. if ('login' === c.user.status || 'error' === c.user.status) {
  173. var n = this.$route.query,
  174. t = n.returnUrl,
  175. r = (n.isRegister, a(n, e))
  176. this.$router.replace({ path: t, query: o({}, r) })
  177. }
  178. },
  179. onLogin: function () {
  180. var e = this
  181. return t(
  182. regeneratorRuntime.mark(function n() {
  183. var t, r, i, a, u
  184. return regeneratorRuntime.wrap(
  185. function (n) {
  186. for (;;)
  187. switch ((n.prev = n.next)) {
  188. case 0:
  189. return (
  190. (n.prev = 0),
  191. (t = {
  192. username: e.username,
  193. client_id: c.clientId[c.platformType],
  194. client_secret: c.clientId[c.platformType]
  195. }),
  196. 'PWD' === e.loginType
  197. ? ((t.password = e.password),
  198. (t.loginType = 'PASSWORD'),
  199. (t.grant_type = 'PASSWORD'))
  200. : ((t.password = e.smsCode),
  201. (t.loginType = 'SMS'),
  202. (t.grant_type = 'SMS')),
  203. (n.next = 5),
  204. f.post('/api-oauth/userlogin', {
  205. requestType: 'form',
  206. data: o({}, t)
  207. })
  208. )
  209. case 5:
  210. return (
  211. (r = n.sent),
  212. (i = r.data),
  213. p(i.token_type + ' ' + i.access_token),
  214. (n.next = 10),
  215. f.get(c.platformApi + '/user/getUserInfo', { initRequest: !0 })
  216. )
  217. case 10:
  218. ;(a = n.sent),
  219. 'SCHOOL' === c.platformType &&
  220. ((u = a.data.schoolInfos ? a.data.schoolInfos[0] : {}),
  221. (a.data.school = u)),
  222. m(a.data),
  223. e.directNext(),
  224. (n.next = 18)
  225. break
  226. case 16:
  227. ;(n.prev = 16), (n.t0 = n.catch(0))
  228. case 18:
  229. case 'end':
  230. return n.stop()
  231. }
  232. },
  233. n,
  234. null,
  235. [[0, 16]]
  236. )
  237. })
  238. )()
  239. },
  240. onSendCode: function () {
  241. var e = this
  242. return t(
  243. regeneratorRuntime.mark(function n() {
  244. return regeneratorRuntime.wrap(function (n) {
  245. for (;;)
  246. switch ((n.prev = n.next)) {
  247. case 0:
  248. if (r(e.username)) {
  249. n.next = 2
  250. break
  251. }
  252. return n.abrupt('return', g('请输入正确的手机号码'))
  253. case 2:
  254. e.imgCodeStatus = !0
  255. case 3:
  256. case 'end':
  257. return n.stop()
  258. }
  259. }, n)
  260. })
  261. )()
  262. },
  263. onCodeSend: function () {
  264. var e = this
  265. ;(this.countDownStatus = !1),
  266. this.$nextTick(function () {
  267. e.$refs.countDownRef.start()
  268. })
  269. },
  270. onFinished: function () {
  271. ;(this.countDownStatus = !0), this.$refs.countDownRef.reset()
  272. },
  273. onChange: function () {
  274. 'PWD' === this.loginType
  275. ? (this.loginType = 'SMS')
  276. : 'SMS' === this.loginType && (this.loginType = 'PWD')
  277. }
  278. },
  279. render: function () {
  280. var e = this
  281. return y('div', { class: w }, [
  282. y('div', { class: O }, [
  283. h('您好,'),
  284. y('br', null, null),
  285. h(' 欢迎使用管乐团'),
  286. this.appName
  287. ]),
  288. y(
  289. _,
  290. { class: T, border: !1 },
  291. {
  292. default: function () {
  293. return [
  294. y(
  295. i,
  296. { style: { marginBottom: '16px' } },
  297. {
  298. default: function () {
  299. return [
  300. y(
  301. u,
  302. { span: 24, class: x },
  303. {
  304. default: function () {
  305. return [h('手机号')]
  306. }
  307. }
  308. ),
  309. y(
  310. u,
  311. { span: 24, class: 'van-hairline--bottom' },
  312. {
  313. default: function () {
  314. return [
  315. y(
  316. S,
  317. {
  318. modelValue: e.username,
  319. 'onUpdate:modelValue': function (n) {
  320. return (e.username = n)
  321. },
  322. name: '手机号',
  323. placeholder: '请输入您的手机号',
  324. type: 'tel',
  325. maxlength: 11
  326. },
  327. null
  328. )
  329. ]
  330. }
  331. }
  332. )
  333. ]
  334. }
  335. }
  336. ),
  337. 'PWD' === e.loginType
  338. ? y(i, null, {
  339. default: function () {
  340. return [
  341. y(
  342. u,
  343. { span: 24, class: x },
  344. {
  345. default: function () {
  346. return [h('密码')]
  347. }
  348. }
  349. ),
  350. y(
  351. u,
  352. { span: 24, class: 'van-hairline--bottom' },
  353. {
  354. default: function () {
  355. return [
  356. y(
  357. S,
  358. {
  359. modelValue: e.password,
  360. 'onUpdate:modelValue': function (n) {
  361. return (e.password = n)
  362. },
  363. type: 'password',
  364. name: '密码',
  365. placeholder: '请输入密码'
  366. },
  367. null
  368. )
  369. ]
  370. }
  371. }
  372. )
  373. ]
  374. }
  375. })
  376. : y(i, null, {
  377. default: function () {
  378. return [
  379. y(
  380. u,
  381. { span: 24, class: x },
  382. {
  383. default: function () {
  384. return [h('验证码')]
  385. }
  386. }
  387. ),
  388. y(
  389. u,
  390. { span: 24, class: 'van-hairline--bottom' },
  391. {
  392. default: function () {
  393. return [
  394. y(
  395. S,
  396. {
  397. modelValue: e.smsCode,
  398. 'onUpdate:modelValue': function (n) {
  399. return (e.smsCode = n)
  400. },
  401. name: '验证码',
  402. placeholder: '请输入验证码',
  403. type: 'tel',
  404. maxlength: 6
  405. },
  406. {
  407. button: function () {
  408. return e.countDownStatus
  409. ? y(
  410. 'span',
  411. { class: C, onClick: e.onSendCode },
  412. [h('获取验证码')]
  413. )
  414. : y(
  415. v,
  416. {
  417. ref: 'countDownRef',
  418. 'auto-start': !1,
  419. time: e.countDownTime,
  420. onFinish: e.onFinished,
  421. format: 'ss秒'
  422. },
  423. null
  424. )
  425. }
  426. }
  427. )
  428. ]
  429. }
  430. }
  431. )
  432. ]
  433. }
  434. })
  435. ]
  436. }
  437. }
  438. ),
  439. y('div', { class: T }, [
  440. y(
  441. b,
  442. {
  443. round: !0,
  444. block: !0,
  445. type: 'primary',
  446. disabled: this.codeDisable,
  447. onClick: this.onLogin
  448. },
  449. {
  450. default: function () {
  451. return [h('提交')]
  452. }
  453. }
  454. ),
  455. y(
  456. b,
  457. { block: !0, round: !0, color: '#F5F7FB', onClick: this.onChange },
  458. {
  459. default: function () {
  460. return ['PWD' === e.loginType ? '验证码登录' : '密码登录']
  461. }
  462. }
  463. )
  464. ]),
  465. this.imgCodeStatus
  466. ? y(
  467. s,
  468. {
  469. value: this.imgCodeStatus,
  470. 'onUpdate:value': function (n) {
  471. return (e.imgCodeStatus = n)
  472. },
  473. phone: this.username,
  474. onClose: function () {
  475. e.imgCodeStatus = !1
  476. },
  477. onSendCode: this.onCodeSend
  478. },
  479. null
  480. )
  481. : null
  482. ])
  483. }
  484. })
  485. )
  486. }
  487. }
  488. }
  489. )
  490. })()