myHomeAPI.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import request from "@/sheep/request";
  2. const myHomeAPI = {
  3. // 社交授权的跳转
  4. socialAuthRedirect: (redirect_url, scopes) => {
  5. return request({
  6. url: "/client/account/wx-login",
  7. method: "POST",
  8. data: {
  9. redirect_url,
  10. scopes,
  11. },
  12. custom: {
  13. showSuccess: true,
  14. loadingMsg: "登陆中",
  15. },
  16. });
  17. },
  18. //获取openId
  19. getObtain: (data) => {
  20. return request({
  21. url: "/client/wechat/callback",
  22. method: "post",
  23. data,
  24. custom: {
  25. showSuccess: true,
  26. loadingMsg: "登陆中",
  27. },
  28. });
  29. },
  30. //获取token和令牌 登录
  31. getTokenInfojhy: (data) => {
  32. return request({
  33. url: "/client/wechat/login",
  34. method: "get",
  35. data,
  36. });
  37. },
  38. //修改用户信息
  39. editUserInfo: (data) => {
  40. return request({
  41. url: "client/account/bind-mobile",
  42. method: "post",
  43. data,
  44. });
  45. },
  46. //通过手机号登录
  47. phoneLogin: (data) => {
  48. return request({
  49. url: "/client/account/login",
  50. method: "post",
  51. data,
  52. });
  53. },
  54. // 更新接口地址
  55. getWechatAuthUrl: (redirect_url, scopes) => {
  56. return request({
  57. url: "/client/wechat/auth-url",
  58. method: "get",
  59. params: {
  60. redirect_uri: redirect_url,
  61. scope: scopes,
  62. },
  63. custom: {
  64. showSuccess: true,
  65. loadingMsg: "获取授权链接...",
  66. },
  67. });
  68. },
  69. };
  70. export default myHomeAPI;