user.ts 620 B

1234567891011121314151617181920212223242526272829
  1. import { ApiInstance } from '../type'
  2. interface LoginData {
  3. userName: string
  4. passWord: string
  5. captcha: string
  6. system: string
  7. captchaId: number
  8. }
  9. interface PasswordEditData {
  10. password: string
  11. newpassword: string
  12. }
  13. const userApi = (axiosInstance: ApiInstance) => ({
  14. // 登录
  15. login: (data: LoginData) => axiosInstance.post('auth/login', data, {
  16. }),
  17. // 获取权限
  18. permission: () => axiosInstance.get('auth/getUserPer', {
  19. }),
  20. // 修改密码
  21. passwordEdit: (data: PasswordEditData) => axiosInstance.post('user/password/edit', data, {
  22. baseURL: '/mock/',
  23. }),
  24. })
  25. export default userApi