user.js 496 B

123456789101112131415161718192021222324252627282930313233
  1. import http from '@/http/api.js'
  2. // 获取token
  3. const token = (tenantId, username, password, type) => {
  4. return http.request({
  5. url: '/galaxy-auth/oauth/token',
  6. method: 'POST',
  7. header: {
  8. 'Tenant-Id': tenantId
  9. },
  10. params: {
  11. tenantId,
  12. username,
  13. password,
  14. grant_type: "password",
  15. scope: "all",
  16. type
  17. }
  18. })
  19. }
  20. // 获取用户信息
  21. const userInfo = () => {
  22. return http.request({
  23. url: '/galaxy-user/info',
  24. method: 'GET',
  25. })
  26. }
  27. export default {
  28. token,
  29. userInfo
  30. }