格式化代码,websocket功能完善

This commit is contained in:
2026-02-18 21:50:05 +08:00
parent 6543e2ccdd
commit b6c133952b
101 changed files with 15829 additions and 10739 deletions
+124 -83
View File
@@ -1,36 +1,36 @@
import request from '@/utils/request'
import request from "@/utils/request";
export default {
// 认证相关
login: {
post: async function (params) {
return await request.post('auth/login', params)
return await request.post("auth/login", params);
},
},
logout: {
post: async function () {
return await request.post('auth/logout')
return await request.post("auth/logout");
},
},
me: {
get: async function () {
return await request.get('auth/me')
return await request.get("auth/me");
},
},
changePassword: {
post: async function (params) {
return await request.post('auth/change-password', params)
return await request.post("auth/change-password", params);
},
},
// 文件上传
upload: {
post: async function (file) {
const formData = new FormData()
formData.append('file', file)
return await request.post('system/upload', formData, {
headers: { 'Content-Type': 'multipart/form-data' }
})
const formData = new FormData();
formData.append("file", file);
return await request.post("system/upload", formData, {
headers: { "Content-Type": "multipart/form-data" },
});
},
},
@@ -38,64 +38,71 @@ export default {
users: {
list: {
get: async function (params) {
return await request.get('auth/users', { params })
return await request.get("auth/users", { params });
},
},
detail: {
get: async function (id) {
return await request.get(`auth/users/${id}`)
return await request.get(`auth/users/${id}`);
},
},
add: {
post: async function (params) {
return await request.post('auth/users', params)
return await request.post("auth/users", params);
},
},
edit: {
put: async function (id, params) {
return await request.put(`auth/users/${id}`, params)
return await request.put(`auth/users/${id}`, params);
},
},
delete: {
delete: async function (id) {
return await request.delete(`auth/users/${id}`)
return await request.delete(`auth/users/${id}`);
},
},
batchDelete: {
post: async function (params) {
return await request.post('auth/users/batch-delete', params)
return await request.post("auth/users/batch-delete", params);
},
},
batchStatus: {
post: async function (params) {
return await request.post('auth/users/batch-status', params)
return await request.post("auth/users/batch-status", params);
},
},
batchDepartment: {
post: async function (params) {
return await request.post('auth/users/batch-department', params)
return await request.post(
"auth/users/batch-department",
params,
);
},
},
batchRoles: {
post: async function (params) {
return await request.post('auth/users/batch-roles', params)
return await request.post("auth/users/batch-roles", params);
},
},
export: {
post: async function (params) {
return await request.post('auth/users/export', params, { responseType: 'blob' })
return await request.post("auth/users/export", params, {
responseType: "blob",
});
},
},
import: {
post: async function (formData) {
return await request.post('auth/users/import', formData, {
headers: { 'Content-Type': 'multipart/form-data' }
})
return await request.post("auth/users/import", formData, {
headers: { "Content-Type": "multipart/form-data" },
});
},
},
downloadTemplate: {
get: async function () {
return await request.get('auth/users/download-template', { responseType: 'blob' })
return await request.get("auth/users/download-template", {
responseType: "blob",
});
},
},
},
@@ -104,27 +111,34 @@ export default {
onlineUsers: {
count: {
get: async function () {
return await request.get('auth/online-users/count')
return await request.get("auth/online-users/count");
},
},
list: {
get: async function (params) {
return await request.get('auth/online-users', { params })
return await request.get("auth/online-users", { params });
},
},
sessions: {
get: async function (userId) {
return await request.get(`auth/online-users/${userId}/sessions`)
return await request.get(
`auth/online-users/${userId}/sessions`,
);
},
},
offline: {
post: async function (userId, params) {
return await request.post(`auth/online-users/${userId}/offline`, params)
return await request.post(
`auth/online-users/${userId}/offline`,
params,
);
},
},
offlineAll: {
post: async function (userId) {
return await request.post(`auth/online-users/${userId}/offline-all`)
return await request.post(
`auth/online-users/${userId}/offline-all`,
);
},
},
},
@@ -133,77 +147,84 @@ export default {
roles: {
list: {
get: async function (params) {
return await request.get('auth/roles', { params })
return await request.get("auth/roles", { params });
},
},
all: {
get: async function () {
return await request.get('auth/roles/all')
return await request.get("auth/roles/all");
},
},
detail: {
get: async function (id) {
return await request.get(`auth/roles/${id}`)
return await request.get(`auth/roles/${id}`);
},
},
add: {
post: async function (params) {
return await request.post('auth/roles', params)
return await request.post("auth/roles", params);
},
},
edit: {
put: async function (id, params) {
return await request.put(`auth/roles/${id}`, params)
return await request.put(`auth/roles/${id}`, params);
},
},
delete: {
delete: async function (id) {
return await request.delete(`auth/roles/${id}`)
return await request.delete(`auth/roles/${id}`);
},
},
batchDelete: {
post: async function (params) {
return await request.post('auth/roles/batch-delete', params)
return await request.post("auth/roles/batch-delete", params);
},
},
batchStatus: {
post: async function (params) {
return await request.post('auth/roles/batch-status', params)
return await request.post("auth/roles/batch-status", params);
},
},
permissions: {
get: async function (id) {
return await request.get(`auth/roles/${id}/permissions`)
return await request.get(`auth/roles/${id}/permissions`);
},
post: async function (id, params) {
return await request.post(`auth/roles/${id}/permissions`, params)
return await request.post(
`auth/roles/${id}/permissions`,
params,
);
},
},
copy: {
post: async function (id, params) {
return await request.post(`auth/roles/${id}/copy`, params)
return await request.post(`auth/roles/${id}/copy`, params);
},
},
batchCopy: {
post: async function (params) {
return await request.post('auth/roles/batch-copy', params)
return await request.post("auth/roles/batch-copy", params);
},
},
export: {
post: async function (params) {
return await request.post('auth/roles/export', params, { responseType: 'blob' })
return await request.post("auth/roles/export", params, {
responseType: "blob",
});
},
},
import: {
post: async function (formData) {
return await request.post('auth/roles/import', formData, {
headers: { 'Content-Type': 'multipart/form-data' }
})
return await request.post("auth/roles/import", formData, {
headers: { "Content-Type": "multipart/form-data" },
});
},
},
downloadTemplate: {
get: async function () {
return await request.get('auth/roles/download-template', { responseType: 'blob' })
return await request.get("auth/roles/download-template", {
responseType: "blob",
});
},
},
},
@@ -212,131 +233,151 @@ export default {
permissions: {
list: {
get: async function (params) {
return await request.get('auth/permissions', { params })
return await request.get("auth/permissions", { params });
},
},
tree: {
get: async function () {
return await request.get('auth/permissions/tree')
return await request.get("auth/permissions/tree");
},
},
menu: {
get: async function () {
return await request.get('auth/permissions/menu')
return await request.get("auth/permissions/menu");
},
},
detail: {
get: async function (id) {
return await request.get(`auth/permissions/${id}`)
return await request.get(`auth/permissions/${id}`);
},
},
add: {
post: async function (params) {
return await request.post('auth/permissions', params)
return await request.post("auth/permissions", params);
},
},
edit: {
put: async function (id, params) {
return await request.put(`auth/permissions/${id}`, params)
return await request.put(`auth/permissions/${id}`, params);
},
},
delete: {
delete: async function (id) {
return await request.delete(`auth/permissions/${id}`)
return await request.delete(`auth/permissions/${id}`);
},
},
batchDelete: {
post: async function (params) {
return await request.post('auth/permissions/batch-delete', params)
return await request.post(
"auth/permissions/batch-delete",
params,
);
},
},
batchStatus: {
post: async function (params) {
return await request.post('auth/permissions/batch-status', params)
return await request.post(
"auth/permissions/batch-status",
params,
);
},
},
export: {
post: async function (params) {
return await request.post('auth/permissions/export', params, { responseType: 'blob' })
return await request.post("auth/permissions/export", params, {
responseType: "blob",
});
},
},
import: {
post: async function (formData) {
return await request.post('auth/permissions/import', formData, {
headers: { 'Content-Type': 'multipart/form-data' }
})
return await request.post("auth/permissions/import", formData, {
headers: { "Content-Type": "multipart/form-data" },
});
},
},
downloadTemplate: {
get: async function () {
return await request.get('auth/permissions/download-template', { responseType: 'blob' })
return await request.get("auth/permissions/download-template", {
responseType: "blob",
});
},
},
},
// 部门管理
departments: {
list: {
get: async function (params) {
return await request.get('auth/departments', { params })
},
// 部门管理
departments: {
list: {
get: async function (params) {
return await request.get("auth/departments", { params });
},
tree: {
get: async function (params) {
return await request.get('auth/departments/tree', { params })
},
},
tree: {
get: async function (params) {
return await request.get("auth/departments/tree", { params });
},
},
all: {
get: async function () {
return await request.get('auth/departments/all')
return await request.get("auth/departments/all");
},
},
detail: {
get: async function (id) {
return await request.get(`auth/departments/${id}`)
return await request.get(`auth/departments/${id}`);
},
},
add: {
post: async function (params) {
return await request.post('auth/departments', params)
return await request.post("auth/departments", params);
},
},
edit: {
put: async function (id, params) {
return await request.put(`auth/departments/${id}`, params)
return await request.put(`auth/departments/${id}`, params);
},
},
delete: {
delete: async function (id) {
return await request.delete(`auth/departments/${id}`)
return await request.delete(`auth/departments/${id}`);
},
},
batchDelete: {
post: async function (params) {
return await request.post('auth/departments/batch-delete', params)
return await request.post(
"auth/departments/batch-delete",
params,
);
},
},
batchStatus: {
post: async function (params) {
return await request.post('auth/departments/batch-status', params)
return await request.post(
"auth/departments/batch-status",
params,
);
},
},
export: {
post: async function (params) {
return await request.post('auth/departments/export', params, { responseType: 'blob' })
return await request.post("auth/departments/export", params, {
responseType: "blob",
});
},
},
import: {
post: async function (formData) {
return await request.post('auth/departments/import', formData, {
headers: { 'Content-Type': 'multipart/form-data' }
})
return await request.post("auth/departments/import", formData, {
headers: { "Content-Type": "multipart/form-data" },
});
},
},
downloadTemplate: {
get: async function () {
return await request.get('auth/departments/download-template', { responseType: 'blob' })
return await request.get("auth/departments/download-template", {
responseType: "blob",
});
},
},
},
}
};
+201 -159
View File
@@ -1,188 +1,211 @@
import request from '@/utils/request'
import request from "@/utils/request";
export default {
// 系统配置管理
configs: {
list: {
get: async function (params) {
return await request.get('system/configs', { params })
return await request.get("system/configs", { params });
},
},
groups: {
get: async function () {
return await request.get('system/configs/groups')
return await request.get("system/configs/groups");
},
},
all: {
get: async function (params) {
return await request.get('system/configs/all', { params })
return await request.get("system/configs/all", { params });
},
},
detail: {
get: async function (id) {
return await request.get(`system/configs/${id}`)
return await request.get(`system/configs/${id}`);
},
},
add: {
post: async function (params) {
return await request.post('system/configs', params)
return await request.post("system/configs", params);
},
},
edit: {
put: async function (id, params) {
return await request.put(`system/configs/${id}`, params)
return await request.put(`system/configs/${id}`, params);
},
},
delete: {
delete: async function (id) {
return await request.delete(`system/configs/${id}`)
return await request.delete(`system/configs/${id}`);
},
},
batchDelete: {
post: async function (params) {
return await request.post('system/configs/batch-delete', params)
return await request.post(
"system/configs/batch-delete",
params,
);
},
},
batchStatus: {
post: async function (params) {
return await request.post('system/configs/batch-status', params)
return await request.post(
"system/configs/batch-status",
params,
);
},
},
},
// 操作日志管理
logs: {
list: {
get: async function (params) {
return await request.get('system/logs', { params })
},
},
detail: {
get: async function (id) {
return await request.get(`system/logs/${id}`)
},
},
delete: {
delete: async function (id) {
return await request.delete(`system/logs/${id}`)
},
},
batchDelete: {
post: async function (params) {
return await request.post('system/logs/batch-delete', params)
},
},
clear: {
post: async function (params) {
return await request.post('system/logs/clear', params)
},
},
export: {
get: async function (params) {
return await request.get('system/logs/export', {
params,
responseType: 'blob'
})
},
},
statistics: {
get: async function (params) {
return await request.get('system/logs/statistics', { params })
},
list: {
get: async function (params) {
return await request.get("system/logs", { params });
},
},
detail: {
get: async function (id) {
return await request.get(`system/logs/${id}`);
},
},
delete: {
delete: async function (id) {
return await request.delete(`system/logs/${id}`);
},
},
batchDelete: {
post: async function (params) {
return await request.post("system/logs/batch-delete", params);
},
},
clear: {
post: async function (params) {
return await request.post("system/logs/clear", params);
},
},
export: {
get: async function (params) {
return await request.get("system/logs/export", {
params,
responseType: "blob",
});
},
},
statistics: {
get: async function (params) {
return await request.get("system/logs/statistics", { params });
},
},
},
// 数据字典管理
dictionaries: {
list: {
get: async function (params) {
return await request.get('system/dictionaries', { params })
},
// 数据字典管理
dictionaries: {
list: {
get: async function (params) {
return await request.get("system/dictionaries", { params });
},
},
all: {
get: async function () {
return await request.get("system/dictionaries/all");
},
},
detail: {
get: async function (id) {
return await request.get(`system/dictionaries/${id}`);
},
},
add: {
post: async function (params) {
return await request.post("system/dictionaries", params);
},
},
edit: {
put: async function (id, params) {
return await request.put(`system/dictionaries/${id}`, params);
},
},
delete: {
delete: async function (id) {
return await request.delete(`system/dictionaries/${id}`);
},
},
batchDelete: {
post: async function (params) {
return await request.post(
"system/dictionaries/batch-delete",
params,
);
},
},
batchStatus: {
post: async function (params) {
return await request.post(
"system/dictionaries/batch-status",
params,
);
},
},
items: {
all: {
get: async function () {
return await request.get('system/dictionaries/all')
},
},
detail: {
get: async function (id) {
return await request.get(`system/dictionaries/${id}`)
},
},
add: {
post: async function (params) {
return await request.post('system/dictionaries', params)
},
},
edit: {
put: async function (id, params) {
return await request.put(`system/dictionaries/${id}`, params)
},
},
delete: {
delete: async function (id) {
return await request.delete(`system/dictionaries/${id}`)
},
},
batchDelete: {
post: async function (params) {
return await request.post('system/dictionaries/batch-delete', params)
},
},
batchStatus: {
post: async function (params) {
return await request.post('system/dictionaries/batch-status', params)
},
},
items: {
all: {
get: async function (code) {
return await request.get(`system/dictionaries/code`, { params: { code } })
},
get: async function (code) {
return await request.get(`system/dictionaries/code`, {
params: { code },
});
},
},
},
},
// 数据字典项管理
dictionaryItems: {
list: {
get: async function (params) {
return await request.get('system/dictionary-items', { params })
return await request.get("system/dictionary-items", { params });
},
},
all: {
get: async function () {
return await request.get('system/dictionary-items/all')
return await request.get("system/dictionary-items/all");
},
},
detail: {
get: async function (id) {
return await request.get(`system/dictionary-items/${id}`)
return await request.get(`system/dictionary-items/${id}`);
},
},
add: {
post: async function (params) {
return await request.post('system/dictionary-items', params)
return await request.post("system/dictionary-items", params);
},
},
edit: {
put: async function (id, params) {
return await request.put(`system/dictionary-items/${id}`, params)
return await request.put(
`system/dictionary-items/${id}`,
params,
);
},
},
delete: {
delete: async function (id) {
return await request.delete(`system/dictionary-items/${id}`)
return await request.delete(`system/dictionary-items/${id}`);
},
},
batchDelete: {
post: async function (params) {
return await request.post('system/dictionary-items/batch-delete', params)
return await request.post(
"system/dictionary-items/batch-delete",
params,
);
},
},
batchStatus: {
post: async function (params) {
return await request.post('system/dictionary-items/batch-status', params)
return await request.post(
"system/dictionary-items/batch-status",
params,
);
},
},
},
@@ -191,52 +214,52 @@ export default {
tasks: {
list: {
get: async function (params) {
return await request.get('system/tasks', { params })
return await request.get("system/tasks", { params });
},
},
all: {
get: async function () {
return await request.get('system/tasks/all')
return await request.get("system/tasks/all");
},
},
detail: {
get: async function (id) {
return await request.get(`system/tasks/${id}`)
return await request.get(`system/tasks/${id}`);
},
},
add: {
post: async function (params) {
return await request.post('system/tasks', params)
return await request.post("system/tasks", params);
},
},
edit: {
put: async function (id, params) {
return await request.put(`system/tasks/${id}`, params)
return await request.put(`system/tasks/${id}`, params);
},
},
delete: {
delete: async function (id) {
return await request.delete(`system/tasks/${id}`)
return await request.delete(`system/tasks/${id}`);
},
},
batchDelete: {
post: async function (params) {
return await request.post('system/tasks/batch-delete', params)
return await request.post("system/tasks/batch-delete", params);
},
},
batchStatus: {
post: async function (params) {
return await request.post('system/tasks/batch-status', params)
return await request.post("system/tasks/batch-status", params);
},
},
run: {
post: async function (id) {
return await request.post(`system/tasks/${id}/run`)
return await request.post(`system/tasks/${id}/run`);
},
},
statistics: {
get: async function () {
return await request.get('system/tasks/statistics')
return await request.get("system/tasks/statistics");
},
},
},
@@ -245,62 +268,62 @@ export default {
cities: {
list: {
get: async function (params) {
return await request.get('system/cities', { params })
return await request.get("system/cities", { params });
},
},
tree: {
get: async function () {
return await request.get('system/cities/tree')
return await request.get("system/cities/tree");
},
},
detail: {
get: async function (id) {
return await request.get(`system/cities/${id}`)
return await request.get(`system/cities/${id}`);
},
},
children: {
get: async function (id) {
return await request.get(`system/cities/${id}/children`)
return await request.get(`system/cities/${id}/children`);
},
},
provinces: {
get: async function () {
return await request.get('system/cities/provinces')
return await request.get("system/cities/provinces");
},
},
cities: {
get: async function (provinceId) {
return await request.get(`system/cities/${provinceId}/cities`)
return await request.get(`system/cities/${provinceId}/cities`);
},
},
districts: {
get: async function (cityId) {
return await request.get(`system/cities/${cityId}/districts`)
return await request.get(`system/cities/${cityId}/districts`);
},
},
add: {
post: async function (params) {
return await request.post('system/cities', params)
return await request.post("system/cities", params);
},
},
edit: {
put: async function (id, params) {
return await request.put(`system/cities/${id}`, params)
return await request.put(`system/cities/${id}`, params);
},
},
delete: {
delete: async function (id) {
return await request.delete(`system/cities/${id}`)
return await request.delete(`system/cities/${id}`);
},
},
batchDelete: {
post: async function (params) {
return await request.post('system/cities/batch-delete', params)
return await request.post("system/cities/batch-delete", params);
},
},
batchStatus: {
post: async function (params) {
return await request.post('system/cities/batch-status', params)
return await request.post("system/cities/batch-status", params);
},
},
},
@@ -309,31 +332,31 @@ export default {
upload: {
single: {
post: async function (formData) {
return await request.post('system/upload', formData, {
headers: { 'Content-Type': 'multipart/form-data' }
})
return await request.post("system/upload", formData, {
headers: { "Content-Type": "multipart/form-data" },
});
},
},
multiple: {
post: async function (formData) {
return await request.post('system/upload/multiple', formData, {
headers: { 'Content-Type': 'multipart/form-data' }
})
return await request.post("system/upload/multiple", formData, {
headers: { "Content-Type": "multipart/form-data" },
});
},
},
base64: {
post: async function (params) {
return await request.post('system/upload/base64', params)
return await request.post("system/upload/base64", params);
},
},
delete: {
post: async function (params) {
return await request.post('system/upload/delete', params)
return await request.post("system/upload/delete", params);
},
},
batchDelete: {
post: async function (params) {
return await request.post('system/upload/batch-delete', params)
return await request.post("system/upload/batch-delete", params);
},
},
},
@@ -342,67 +365,78 @@ export default {
notifications: {
list: {
get: async function (params) {
return await request.get('system/notifications', { params })
return await request.get("system/notifications", { params });
},
},
unread: {
get: async function (params) {
return await request.get('system/notifications/unread', { params })
return await request.get("system/notifications/unread", {
params,
});
},
},
unreadCount: {
get: async function () {
return await request.get('system/notifications/unread-count')
return await request.get("system/notifications/unread-count");
},
},
detail: {
get: async function (id) {
return await request.get(`system/notifications/${id}`)
return await request.get(`system/notifications/${id}`);
},
},
markAsRead: {
post: async function (id) {
return await request.post(`system/notifications/${id}/read`)
return await request.post(`system/notifications/${id}/read`);
},
},
batchMarkAsRead: {
post: async function (params) {
return await request.post('system/notifications/batch-read', params)
return await request.post(
"system/notifications/batch-read",
params,
);
},
},
markAllAsRead: {
post: async function () {
return await request.post('system/notifications/read-all')
return await request.post("system/notifications/read-all");
},
},
delete: {
delete: async function (id) {
return await request.delete(`system/notifications/${id}`)
return await request.delete(`system/notifications/${id}`);
},
},
batchDelete: {
post: async function (params) {
return await request.post('system/notifications/batch-delete', params)
return await request.post(
"system/notifications/batch-delete",
params,
);
},
},
clearRead: {
post: async function () {
return await request.post('system/notifications/clear-read')
return await request.post("system/notifications/clear-read");
},
},
statistics: {
get: async function () {
return await request.get('system/notifications/statistics')
return await request.get("system/notifications/statistics");
},
},
send: {
post: async function (params) {
return await request.post('system/notifications/send', params)
return await request.post("system/notifications/send", params);
},
},
retryUnsent: {
post: async function (params) {
return await request.post('system/notifications/retry-unsent', params)
return await request.post(
"system/notifications/retry-unsent",
params,
);
},
},
},
@@ -412,70 +446,78 @@ export default {
configs: {
all: {
get: async function () {
return await request.get('system/configs')
return await request.get("system/configs");
},
},
group: {
get: async function (params) {
return await request.get('system/configs/group', { params })
return await request.get("system/configs/group", {
params,
});
},
},
key: {
get: async function (params) {
return await request.get('system/configs/key', { params })
return await request.get("system/configs/key", { params });
},
},
},
dictionaries: {
all: {
get: async function () {
return await request.get('system/dictionaries')
return await request.get("system/dictionaries");
},
},
code: {
get: async function (params) {
return await request.get('system/dictionaries/code', { params })
return await request.get("system/dictionaries/code", {
params,
});
},
},
detail: {
get: async function (id) {
return await request.get(`system/dictionaries/${id}`)
return await request.get(`system/dictionaries/${id}`);
},
},
},
cities: {
tree: {
get: async function () {
return await request.get('system/cities/tree')
return await request.get("system/cities/tree");
},
},
provinces: {
get: async function () {
return await request.get('system/cities/provinces')
return await request.get("system/cities/provinces");
},
},
cities: {
get: async function (provinceId) {
return await request.get(`system/cities/${provinceId}/cities`)
return await request.get(
`system/cities/${provinceId}/cities`,
);
},
},
districts: {
get: async function (cityId) {
return await request.get(`system/cities/${cityId}/districts`)
return await request.get(
`system/cities/${cityId}/districts`,
);
},
},
detail: {
get: async function (id) {
return await request.get(`system/cities/${id}`)
return await request.get(`system/cities/${id}`);
},
},
},
upload: {
post: async function (formData) {
return await request.post('system/upload', formData, {
headers: { 'Content-Type': 'multipart/form-data' }
})
return await request.post("system/upload", formData, {
headers: { "Content-Type": "multipart/form-data" },
});
},
},
},
}
};