login.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import request from '@/utils/request'
  2. const client_id = 'web'
  3. const client_secret = '123456'
  4. const scope = 'server'
  5. // 登录方法
  6. export function login(username, password, code, uuid, type, shortMessageCode, unionId) {
  7. return request({
  8. url: '/auth/zcLogin',
  9. method: 'post',
  10. data: { username, password, code, uuid, type, shortMessageCode, unionId}
  11. })
  12. }
  13. // 刷新方法
  14. export function refreshToken() {
  15. return request({
  16. url: '/auth/refresh',
  17. method: 'post'
  18. })
  19. }
  20. // 获取用户详细信息
  21. export function getInfo() {
  22. return request({
  23. url: '/system/user/getInfo',
  24. method: 'get'
  25. })
  26. }
  27. // 退出方法
  28. export function logout() {
  29. return request({
  30. url: '/auth/logout',
  31. method: 'delete'
  32. })
  33. }
  34. // 获取验证码
  35. export function getCodeImg() {
  36. return request({
  37. url: '/code',
  38. method: 'get'
  39. })
  40. }
  41. // 查询域名
  42. export function listSscDomain(sscDomain) {
  43. return request({
  44. url: '/system/styleConfig/query/' + sscDomain,
  45. method: 'get'
  46. })
  47. }
  48. // 发送登陆短信验证码
  49. export function sendShortMessage(phone, imgCode, uuid) {
  50. return request({
  51. url: '/system/message/sendShortMessage',
  52. method: 'post',
  53. data : {
  54. phone : phone,
  55. verificationCode : '000000_verification_code',
  56. imgCode : imgCode,
  57. uuid : uuid
  58. }
  59. })
  60. }
  61. // 选择企业登陆
  62. export function chooseCompanyLogin(companyId) {
  63. return request({
  64. url: '/system/user/chooseCompanyLogin',
  65. method: 'post',
  66. data: {companyId : companyId}
  67. })
  68. }