login.uts 984 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * 登录接口
  3. */
  4. import { request } from '../../utils/request'
  5. /**
  6. * 账号密码登录
  7. * @returns 返回整个响应对象 { status, msg, success, data }
  8. */
  9. export const loginByAccount = (username: string, password: string): Promise<any> => {
  10. return request({
  11. url: '/login',
  12. method: 'POST',
  13. header: {
  14. isToken: false,
  15. repeatSubmit: false
  16. },
  17. data: {
  18. username: username,
  19. password: password,
  20. code: 'app20251203'
  21. },
  22. })
  23. }
  24. export const getUserInfo = ():Promise<any> =>{
  25. return request({
  26. url: '/getInfo',
  27. method: 'GET'
  28. })
  29. }
  30. export const resetPassword = (username: string, password: string, newPassword: string): Promise<any> => {
  31. return request({
  32. url: '/initPassword',
  33. method: 'PUT',
  34. header: {
  35. isToken: false,
  36. repeatSubmit: false
  37. },
  38. data: {
  39. username: username,
  40. newPassword: newPassword,
  41. password: password
  42. },
  43. })
  44. }