初始化项目

This commit is contained in:
2026-02-08 22:38:13 +08:00
commit 334d2c6312
201 changed files with 32724 additions and 0 deletions
+302
View File
@@ -0,0 +1,302 @@
import request from '@/utils/request'
export default {
// 认证相关
login: {
post: async function (params) {
return await request.post('auth/login', params)
},
},
logout: {
post: async function () {
return await request.post('auth/logout')
},
},
refresh: {
post: async function () {
return await request.post('auth/refresh')
},
},
me: {
get: async function () {
return await request.get('auth/me')
},
},
changePassword: {
post: async function (params) {
return await request.post('auth/change-password', params)
},
},
// 用户管理
users: {
list: {
get: async function (params) {
return await request.get('users', { params })
},
},
detail: {
get: async function (id) {
return await request.get(`users/${id}`)
},
},
add: {
post: async function (params) {
return await request.post('users', params)
},
},
edit: {
put: async function (id, params) {
return await request.put(`users/${id}`, params)
},
},
delete: {
delete: async function (id) {
return await request.delete(`users/${id}`)
},
},
batchDelete: {
post: async function (params) {
return await request.post('users/batch-delete', params)
},
},
batchStatus: {
post: async function (params) {
return await request.post('users/batch-status', params)
},
},
batchDepartment: {
post: async function (params) {
return await request.post('users/batch-department', params)
},
},
batchRoles: {
post: async function (params) {
return await request.post('users/batch-roles', params)
},
},
export: {
post: async function (params) {
return await request.post('users/export', params, { responseType: 'blob' })
},
},
import: {
post: async function (formData) {
return await request.post('users/import', formData, {
headers: { 'Content-Type': 'multipart/form-data' }
})
},
},
downloadTemplate: {
get: async function () {
return await request.get('users/download-template', { responseType: 'blob' })
},
},
},
// 在线用户管理
onlineUsers: {
count: {
get: async function () {
return await request.get('online-users/count')
},
},
list: {
get: async function (params) {
return await request.get('online-users', { params })
},
},
sessions: {
get: async function (userId) {
return await request.get(`online-users/${userId}/sessions`)
},
},
offline: {
post: async function (userId, params) {
return await request.post(`online-users/${userId}/offline`, params)
},
},
offlineAll: {
post: async function (userId) {
return await request.post(`online-users/${userId}/offline-all`)
},
},
},
// 角色管理
roles: {
list: {
get: async function (params) {
return await request.get('roles', { params })
},
},
all: {
get: async function () {
return await request.get('roles/all')
},
},
detail: {
get: async function (id) {
return await request.get(`roles/${id}`)
},
},
add: {
post: async function (params) {
return await request.post('roles', params)
},
},
edit: {
put: async function (id, params) {
return await request.put(`roles/${id}`, params)
},
},
delete: {
delete: async function (id) {
return await request.delete(`roles/${id}`)
},
},
batchDelete: {
post: async function (params) {
return await request.post('roles/batch-delete', params)
},
},
batchStatus: {
post: async function (params) {
return await request.post('roles/batch-status', params)
},
},
permissions: {
get: async function (id) {
return await request.get(`roles/${id}/permissions`)
},
post: async function (id, params) {
return await request.post(`roles/${id}/permissions`, params)
},
},
copy: {
post: async function (id, params) {
return await request.post(`roles/${id}/copy`, params)
},
},
batchCopy: {
post: async function (params) {
return await request.post('roles/batch-copy', params)
},
},
},
// 权限管理
permissions: {
list: {
get: async function (params) {
return await request.get('permissions', { params })
},
},
tree: {
get: async function () {
return await request.get('permissions/tree')
},
},
menu: {
get: async function () {
return await request.get('permissions/menu')
},
},
detail: {
get: async function (id) {
return await request.get(`permissions/${id}`)
},
},
add: {
post: async function (params) {
return await request.post('permissions', params)
},
},
edit: {
put: async function (id, params) {
return await request.put(`permissions/${id}`, params)
},
},
delete: {
delete: async function (id) {
return await request.delete(`permissions/${id}`)
},
},
batchDelete: {
post: async function (params) {
return await request.post('permissions/batch-delete', params)
},
},
batchStatus: {
post: async function (params) {
return await request.post('permissions/batch-status', params)
},
},
},
// 部门管理
departments: {
list: {
get: async function (params) {
return await request.get('departments', { params })
},
},
tree: {
get: async function () {
return await request.get('departments/tree')
},
},
all: {
get: async function () {
return await request.get('departments/all')
},
},
detail: {
get: async function (id) {
return await request.get(`departments/${id}`)
},
},
add: {
post: async function (params) {
return await request.post('departments', params)
},
},
edit: {
put: async function (id, params) {
return await request.put(`departments/${id}`, params)
},
},
delete: {
delete: async function (id) {
return await request.delete(`departments/${id}`)
},
},
batchDelete: {
post: async function (params) {
return await request.post('departments/batch-delete', params)
},
},
batchStatus: {
post: async function (params) {
return await request.post('departments/batch-status', params)
},
},
export: {
post: async function (params) {
return await request.post('departments/export', params, { responseType: 'blob' })
},
},
import: {
post: async function (formData) {
return await request.post('departments/import', formData, {
headers: { 'Content-Type': 'multipart/form-data' }
})
},
},
downloadTemplate: {
get: async function () {
return await request.get('departments/download-template', { responseType: 'blob' })
},
},
},
}