user.js 849 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import http from '@/http/api.js'
  2. // 获取token
  3. const token = (uuid, phone, code) => {
  4. return http.request({
  5. url: '/blade-auth/oauth/token',
  6. method: 'POST',
  7. header: {
  8. 'Tenant-Id': '000000',
  9. },
  10. params: {
  11. 'Captcha-Key': uuid,
  12. 'Phone-Key':phone,
  13. 'Captcha-Code':code,
  14. grant_type: "phone",
  15. scope: "all",
  16. type:'phone'
  17. }
  18. })
  19. }
  20. // 获取验证码
  21. export function getPhoneVerifyCode(data){
  22. return http.request({
  23. url: '/blade-auth/verification/getPhoneVerifyCode',
  24. method: 'GET',
  25. data
  26. })
  27. }
  28. // 获取用户信息
  29. const userInfo = () => {
  30. return http.request({
  31. url: '/blade-user/info',
  32. method: 'GET',
  33. })
  34. }
  35. // 获取版本
  36. const getVersion = (params) => {
  37. return http.request({
  38. url: '/store-goods/appversion/getLatestVersion',
  39. method: 'GET',
  40. params
  41. })
  42. }
  43. export default {
  44. token,
  45. userInfo,
  46. getVersion
  47. }