emailUser.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import request from '@/utils/request';
  2. export function fetchEmailUserList(params) {
  3. return request.get('/email_user/list', {
  4. params,
  5. });
  6. }
  7. // 发送邮箱登录验证码登录
  8. export function fetchSendLoginCode(email) {
  9. return request.post('/email_user/send_login_code', {
  10. email,
  11. });
  12. }
  13. // 邮箱验证码登录
  14. export function fetchEmailCodeLogin({ email, code }) {
  15. return request.post('/email_user/login', {
  16. email,
  17. code,
  18. });
  19. }
  20. // 发送邮箱注册验证码登录
  21. export function fetchSendRegisterCode(email) {
  22. return request.post('/email_user/send_register_code', {
  23. email,
  24. });
  25. }
  26. /** 注册 */
  27. export function fetchRegister({ email, code }) {
  28. return request.post('/email_user/register', {
  29. email,
  30. code,
  31. });
  32. }
  33. // 绑定邮箱
  34. export function fetchBindEmail({ email, code }) {
  35. return request.post('/email_user/bind_email', {
  36. email,
  37. code,
  38. });
  39. }
  40. // 发送绑定邮箱验证码
  41. export function fetchSendBindEmailCode(email) {
  42. return request.post('/email_user/send_bind_code', {
  43. email,
  44. });
  45. }
  46. // 取消绑定邮箱
  47. export function fetchCancelBindEmail(code) {
  48. return request.post('/email_user/cancel_bind_email', {
  49. code,
  50. });
  51. }
  52. // 发送取消绑定邮箱验证码
  53. export function fetchCancelSendBindEmailCode(email) {
  54. return request.post('/email_user/send_cancel_bind_code', {
  55. email,
  56. });
  57. }