login.html 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>登录</title>
  7. </head>
  8. <body>
  9. <script src="https://cdn.jsdelivr.net/npm/axios@0.26.1/dist/axios.min.js"></script>
  10. <script>
  11. const phone = '' // 这里填手机号
  12. const password = '' // 这里填密码
  13. const fileUpdateTime = {}
  14. if (!phone || !password) {
  15. const msg = '请设置你的手机号码和密码'
  16. alert(msg)
  17. throw new Error(msg)
  18. }
  19. async function login() {
  20. const res = await axios({
  21. url: `/login/cellphone`,
  22. method: 'post',
  23. data: {
  24. phone: phone,
  25. password: password,
  26. },
  27. })
  28. return res.data.cookie
  29. }
  30. async function main() {
  31. const cookieToken = await login()
  32. const res = await axios({
  33. url: `/login/status`,
  34. method: 'post',
  35. data: {
  36. cookie: cookieToken,
  37. },
  38. })
  39. }
  40. main()
  41. </script>
  42. </body>
  43. </html>