mirror of
https://github.com/zclzone/vue-naive-admin.git
synced 2025-12-28 12:10:20 +08:00
perf: 修改接口请求的axios实例别名
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { defAxios } from '@/utils/http'
|
||||
import { defAxios as request } from '@/utils/http'
|
||||
|
||||
export function getUsers(data = {}) {
|
||||
return defAxios({
|
||||
return request({
|
||||
url: '/users',
|
||||
method: 'get',
|
||||
data,
|
||||
@@ -10,12 +10,12 @@ export function getUsers(data = {}) {
|
||||
|
||||
export function getUser(id) {
|
||||
if (id) {
|
||||
return defAxios({
|
||||
return request({
|
||||
url: `/user/${id}`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
return defAxios({
|
||||
return request({
|
||||
url: '/user',
|
||||
method: 'get',
|
||||
})
|
||||
@@ -23,14 +23,14 @@ export function getUser(id) {
|
||||
|
||||
export function saveUser(data = {}, id) {
|
||||
if (id) {
|
||||
return defAxios({
|
||||
return request({
|
||||
url: '/user',
|
||||
method: 'put',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
return defAxios({
|
||||
return request({
|
||||
url: `/user/${id}`,
|
||||
method: 'put',
|
||||
data,
|
||||
|
||||
Reference in New Issue
Block a user