login-legacy.ef512287.js 15 KB

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