index.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import fetch from '../fetch.js'
  2. export default {
  3. /**
  4. * 获取验证码
  5. * @returns {*}
  6. */
  7. captcha () {
  8. return fetch('/blade-auth/oauth/captcha')
  9. },
  10. login (param, hader) {
  11. return fetch('/blade-auth/oauth/token', param, 'post', 'form', {
  12. 'Tenant-Id': '000000',
  13. 'Captcha-Key': hader.captchaKey,
  14. 'Captcha-Code': hader.captchaCode
  15. })
  16. },
  17. sendSMS (params) {
  18. return fetch('/blade-pc-applet/wechat/home/getHomeNewList', params)
  19. },
  20. /**
  21. * 退出登录
  22. * @returns {Promise<unknown>}
  23. */
  24. logout () {
  25. return fetch('/blade-auth/oauth/logout')
  26. },
  27. getUserInfo () {
  28. return fetch('/blade-project-manage-v2/other/v1/getUserInfo')
  29. },
  30. /**
  31. * 获取按钮权限
  32. * @returns {Promise | Promise<unknown>}
  33. */
  34. getPermission () {
  35. return fetch('/blade-system/menu/buttons?clientId=project_web')
  36. },
  37. qrCode () {
  38. return fetch('/wutong-base/oauth/qrcodeLogin')
  39. },
  40. qrCodeLogin (params) {
  41. return fetch('/wutong-base/oauth/getUserInfo', params)
  42. },
  43. loginByCode (param) {
  44. return fetch('/blade-auth/oauth/token', param, 'post', 'form', {
  45. 'Tenant-Id': '000000'
  46. })
  47. }
  48. }