1
0
mirror of https://github.com/zclzone/vue-naive-admin.git synced 2025-12-28 12:10:20 +08:00

first commit

This commit is contained in:
zhangchuanlong
2022-01-08 17:20:46 +08:00
commit 8d0158be7c
80 changed files with 5240 additions and 0 deletions

38
src/api/user/index.js Normal file
View File

@@ -0,0 +1,38 @@
import { defAxios, mockAxios } from '@/utils/http'
export function getUsers(data = {}) {
return defAxios({
url: '/users',
method: 'get',
data,
})
}
export function getUser(id) {
if (id) {
return defAxios({
url: `/user/${id}`,
method: 'get',
})
}
return defAxios({
url: '/user',
method: 'get',
})
}
export function saveUser(data = {}, id) {
if (id) {
return defAxios({
url: '/user',
method: 'put',
data,
})
}
return defAxios({
url: `/user/${id}`,
method: 'put',
data,
})
}