index.ts 785 B

12345678910111213141516171819202122232425262728
  1. import { defHttp } from '@/config/axios'
  2. import { ProfileVO } from './types'
  3. // 查询用户个人信息
  4. export const getUserProfileApi = () => {
  5. return defHttp.get<ProfileVO>({ url: '/system/user/profile/get' })
  6. }
  7. // 修改用户个人信息
  8. export const updateUserProfileApi = ({ params }) => {
  9. return defHttp.put({ url: '/system/user/profile/update', params })
  10. }
  11. // 用户密码重置
  12. export const updateUserPwdApi = (oldPassword: string, newPassword: string) => {
  13. return defHttp.put({
  14. url: '/system/user/profile/update-password',
  15. params: {
  16. oldPassword: oldPassword,
  17. newPassword: newPassword
  18. }
  19. })
  20. }
  21. // 用户头像上传
  22. export const uploadAvatarApi = (data) => {
  23. return defHttp.put({ url: '/system/user/profile/update-avatar', data: data })
  24. }