user.js 868 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. 'Login-Type':2,
  12. 'Captcha-Key': uuid,
  13. 'Phone-Key':phone,
  14. 'Captcha-Code':code,
  15. grant_type: "phone",
  16. scope: "all",
  17. type:'phone'
  18. }
  19. })
  20. }
  21. // 获取验证码
  22. export function getPhoneVerifyCode(data){
  23. return http.request({
  24. url: '/blade-auth/verification/getPhoneVerifyCode',
  25. method: 'GET',
  26. data
  27. })
  28. }
  29. // 获取用户信息
  30. const userInfo = () => {
  31. return http.request({
  32. url: '/blade-user/info',
  33. method: 'GET',
  34. })
  35. }
  36. // 获取版本
  37. const getVersion = (params) => {
  38. return http.request({
  39. url: '/store-goods/appversion/getLatestVersion',
  40. method: 'GET',
  41. params
  42. })
  43. }
  44. export default {
  45. token,
  46. userInfo,
  47. getVersion
  48. }