login.ts 681 B

123456789101112131415161718192021222324
  1. import { Login } from '@/api/interface/index'
  2. import http from '@/api'
  3. /**
  4. * @name 登录模块
  5. */
  6. // 用户登录
  7. export const loginApi = (params: Login.ReqLoginForm) => {
  8. return http.post<Login.ResLogin>('/auth/login', params, { loading: true, isEncrypt: true }) // 正常 post json 请求 ==> application/json
  9. }
  10. // 用户退出登录
  11. export const logoutApi = () => {
  12. return http.post('/auth/logout', {}, { loading: false })
  13. }
  14. // 用户退出登录
  15. export const getInfoApi = () => {
  16. return http.get('/system/user/getInfo', {}, { loading: false })
  17. }
  18. // 用户退出登录
  19. export const getCodeImg = () => {
  20. return http.get('/captchaImage', {}, { loading: false })
  21. }