refactor: vue3 axios api ...

This commit is contained in:
xingyu
2022-07-19 22:33:54 +08:00
parent ba96eef51a
commit 9e2e220b69
121 changed files with 1022 additions and 9700 deletions

View File

@@ -1,19 +1,20 @@
import { defHttp } from '@/config/axios'
import { ProfileVO } from './types'
import { useAxios } from '@/hooks/web/useAxios'
const request = useAxios()
// 查询用户个人信息
export const getUserProfileApi = () => {
return defHttp.get<ProfileVO>({ url: '/system/user/profile/get' })
return request.get({ url: '/system/user/profile/get' })
}
// 修改用户个人信息
export const updateUserProfileApi = ({ params }) => {
return defHttp.put({ url: '/system/user/profile/update', params })
export const updateUserProfileApi = (params) => {
return request.put({ url: '/system/user/profile/update', params })
}
// 用户密码重置
export const updateUserPwdApi = (oldPassword: string, newPassword: string) => {
return defHttp.put({
return request.put({
url: '/system/user/profile/update-password',
params: {
oldPassword: oldPassword,
@@ -24,5 +25,5 @@ export const updateUserPwdApi = (oldPassword: string, newPassword: string) => {
// 用户头像上传
export const uploadAvatarApi = (data) => {
return defHttp.put({ url: '/system/user/profile/update-avatar', data: data })
return request.put({ url: '/system/user/profile/update-avatar', data: data })
}