login.uts 592 B

1234567891011121314151617181920212223242526272829303132
  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. },
  21. })
  22. }
  23. export const getUserInfo = ():Promise<any> =>{
  24. return request({
  25. url: '/getInfo',
  26. method: 'GET'
  27. })
  28. }