diff --git a/.cursorrule b/.cursorrule new file mode 100644 index 0000000..c5360b4 --- /dev/null +++ b/.cursorrule @@ -0,0 +1,196 @@ +007 Admin UI项目,基于elementplus+vue3+vite+vue-router进行开发的企业级高端后台管理系统UI。 + +使用pnpm包管理器。 + +组件封装到src/components目录下。 +路由封装到src/router目录下。 +api封装到src/api目录下。 +store封装到src/store目录下。 +页面封装到src/views目录下。 + +当你实现一个通用组件后,应该在compoents.md文件中记录下来,记录组件名称、参数、事件、使用方法。 + +请保持整体风格样式统一,也就是说在实现一个页面或者组件之前你需要先阅读其他已经实现的页面。 +在没有实现具体页面之前禁止注册路由。 +在需要的情况下你需要注册侧边栏 +请使用vue3 setup语法糖开发,禁止使用scss。禁止使用ts。 + +注册侧边栏在/config/menus.js文件中。 + + + +## 1. 基础布局规范 +```css +/* 页面容器 */ +.page-container { + padding: 0; +} + +/* 筛选容器 */ +.filter-container { + margin-bottom: 20px; + border-radius: 8px; + box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05); +} + +/* 搜索表单 */ +.search-form { + margin-bottom: 15px; +} + +/* 操作栏 */ +.action-bar { + margin-top: 10px; + display: flex; + flex-wrap: wrap; + gap: 12px; +} + +/* 表格容器 */ +.table-container { + border-radius: 8px; + box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05); +} +``` + +## 2. 表格样式规范 +```css +/* 表格基础样式 */ +:deep(.el-table) { + border-radius: 8px; + overflow: hidden; + background: transparent; +} + +/* 表头样式 */ +:deep(.el-table th) { + background-color: #f8f9fb !important; + font-weight: 600; + color: #1f2937; + height: 50px; + padding: 8px 0; +} + +/* 单元格样式 */ +:deep(.el-table td) { + padding: 12px 0; +} + +/* 斑马纹样式 */ +:deep(.el-table--striped .el-table__body tr.el-table__row--striped td) { + background: #f8fafc; +} + +/* 行悬停效果 */ +:deep(.el-table__body tr:hover > td) { + background-color: #f1f5f9 !important; +} + +/* 行过渡动画 */ +:deep(.el-table__body tr) { + transition: all 0.3s ease; +} +``` + +## 3. 分页样式规范 +```css +/* 分页容器 */ +.pagination { + margin-top: 24px; + justify-content: flex-end; + padding: 0 16px; +} + +/* 分页基础样式 */ +:deep(.el-pagination) { + --el-pagination-hover-color: #1f2937; +} + +/* 禁用按钮样式 */ +:deep(.el-pagination button:disabled) { + background-color: #f1f5f9; +} + +/* 页码样式 */ +:deep(.el-pagination .el-pager li) { + border-radius: 4px; + margin: 0 2px; + transition: all 0.3s ease; +} + +/* 激活页码样式 */ +:deep(.el-pagination .el-pager li.active) { + background-color: #1f2937; + color: white; + font-weight: bold; +} + +/* 页码悬停效果 */ +:deep(.el-pagination .el-pager li:hover:not(.active)) { + background-color: #f1f5f9; +} +``` + +## 4. 对话框样式规范 +```css +/* 对话框底部 */ +.dialog-footer { + display: flex; + justify-content: flex-end; + gap: 12px; +} +``` + +## 5. 响应式设计规范 +```css +/* 移动端适配 */ +@media (max-width: 768px) { + .el-form-item { + margin-bottom: 12px; + } + + .action-bar { + flex-direction: column; + align-items: stretch; + } + + .action-bar .el-button { + width: 100%; + margin-left: 0 !important; + } + + :deep(.el-table th) { + padding: 6px 0; + } + + :deep(.el-table td) { + padding: 8px 0; + } +} +``` + +## 6. 颜色规范 +- 主色:#1f2937 +- 背景色:#f8f9fb +- 悬停色:#f1f5f9 +- 文字主色:#1f2937 +- 文字次色:#64748b + +## 7. 间距规范 +- 页面内边距:0 +- 卡片间距:20px +- 表单间距:15px +- 按钮间距:12px +- 表格内边距:8px-12px + +## 8. 圆角规范 +- 卡片圆角:8px +- 按钮圆角:4px +- 表格圆角:8px + +## 9. 阴影规范 +- 卡片阴影:0 2px 12px 0 rgba(0, 0, 0, 0.05) + +## 10. 动画规范 +- 过渡时间:0.3s +- 过渡效果:ease \ No newline at end of file diff --git a/README.md b/README.md index 9224482..52e6d73 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,81 @@ -# Vue 3 + Vite + ElementPlus +# 007UI 后台管理系统 -This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 ` \ No newline at end of file + +// 设置不同深度的主题色 +for (let i = 1; i <= 9; i++) { + useCssVar(`--el-color-primary-light-${i}`, document.documentElement).value = + i <= 5 + ? `rgba(24, 144, 255, ${1 - i * 0.1})` + : '#f0f9ff' + + if (i <= 2) { + useCssVar(`--el-color-primary-dark-${i}`, document.documentElement).value = + generateDarkColor(primaryColor, i) + } +} + + + \ No newline at end of file diff --git a/src/api/domain.js b/src/api/domain.js new file mode 100644 index 0000000..e6cddcd --- /dev/null +++ b/src/api/domain.js @@ -0,0 +1,25 @@ +import request from "@/utils/request.js"; + +// 获取域名白名单列表 +export function getDomainList(params) { + return request.get("/api/v1/admin/server/domain_withe/list",params) +} + +// 添加域名白名单 +export function addDomain(data) { + return request.post("/api/v1/admin/server/domain_withe/add",data) +} + +// 删除域名白名单 +export function deleteDomain(id) { + return request.post("/api/v1/admin/server/domain_withe/delete",{domain_id: id}) +} + +// 批量删除域名白名单 +export async function batchDeleteDomain(ids) { + let promises = [] + for (let id of ids) { + promises.push(deleteDomain(id)) + } + return await Promise.all(promises) +} \ No newline at end of file diff --git a/src/api/login.js b/src/api/login.js new file mode 100644 index 0000000..dccf8fd --- /dev/null +++ b/src/api/login.js @@ -0,0 +1,10 @@ +import request from "@/utils/request.js"; + + +export const userLogin = (username,password) => { + return request.post("/api/v1/user/login",{username,password}) +} + +export const getUserInfo = () => { + return request.get("/api/v1/users/info/info") +} \ No newline at end of file diff --git a/src/api/ticket.js b/src/api/ticket.js new file mode 100644 index 0000000..dfc61f5 --- /dev/null +++ b/src/api/ticket.js @@ -0,0 +1,70 @@ +import request from "@/utils/request.js"; +/** + * 获取工单列表 + * @param {Object} params 查询参数 + * @returns {Promise} + */ + +export function getTickerList(count, page, status) { + return request.get('/api/v1/admin/work_order/list', { count, page, status }) +} + +// 待处理 +export function getPendingTicketList(count, page) { + return getTickerList(count,page,0) +} + +// 进行中 +export function getProcessingTicketList(count, page) { + return getTickerList(count,page,1) +} + +//已回复 +export function getRepliedTicketList(count, page) { + return getTickerList(count,page,2) +} + +// 已解决 +export function getCompletedTicketList(count, page) { + return getTickerList(count,page,3) +} + +// 获取详情 +export function getTicketDetail(work_id) { + return request.get('/api/v1/admin/work_order/detail', { work_id }) +} + +// 回复 +export function replyTicket(work_id, content, files) { + return request.post('/api/v1/admin/work_order/reply', { work_id, content, files }) +} + +// 关闭工单 +export function closeTicket(work_id) { + return request.post('/api/v1/admin/work_order/close', { work_id }) +} + +export function getFile(file_id) { + return request.get('/api/v1/tool/file/down', { file_id }) +} + +// 获取用户头像 +export function getUserAvatar(user_id) { + // TODO: 实现获取用户头像的逻辑 + return `https://avatar.example.com/${user_id}` +} + +// 获取文件图片 +export async function getFileImage(file_id) { + let resp = await getFile(file_id) + console.log(resp.data.content) + return resp.data.content +} + +// 解析多个文件ID为图片URL数组 +export async function parseFilesToImages(files) { + if (!files || files === '') return [] + + const fileIds = files.split(',') + return await Promise.all(fileIds.map(async (id) => await getFileImage(id.trim()))) +} \ No newline at end of file diff --git a/src/assets/404.svg b/src/assets/404.svg new file mode 100644 index 0000000..151434a --- /dev/null +++ b/src/assets/404.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + 404 + + + + + + + + \ No newline at end of file diff --git a/src/assets/logo.png b/src/assets/logo.png new file mode 100644 index 0000000..6bc8dad Binary files /dev/null and b/src/assets/logo.png differ diff --git a/src/assets/logo.svg b/src/assets/logo.svg new file mode 100644 index 0000000..c5d1427 --- /dev/null +++ b/src/assets/logo.svg @@ -0,0 +1,6 @@ + + + + 007 + UI + \ No newline at end of file diff --git a/src/components/Charts/BarChart.vue b/src/components/Charts/BarChart.vue new file mode 100644 index 0000000..c3ca8b2 --- /dev/null +++ b/src/components/Charts/BarChart.vue @@ -0,0 +1,109 @@ + + + \ No newline at end of file diff --git a/src/components/Charts/BaseEChart.vue b/src/components/Charts/BaseEChart.vue new file mode 100644 index 0000000..4096b8c --- /dev/null +++ b/src/components/Charts/BaseEChart.vue @@ -0,0 +1,88 @@ + + + + + \ No newline at end of file diff --git a/src/components/Charts/LineChart.vue b/src/components/Charts/LineChart.vue new file mode 100644 index 0000000..fb73b29 --- /dev/null +++ b/src/components/Charts/LineChart.vue @@ -0,0 +1,109 @@ + + + \ No newline at end of file diff --git a/src/components/Charts/PieChart.vue b/src/components/Charts/PieChart.vue new file mode 100644 index 0000000..39030e1 --- /dev/null +++ b/src/components/Charts/PieChart.vue @@ -0,0 +1,88 @@ + + + \ No newline at end of file diff --git a/src/components/Container.vue b/src/components/Container.vue new file mode 100644 index 0000000..1673b63 --- /dev/null +++ b/src/components/Container.vue @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue deleted file mode 100644 index 546ebbc..0000000 --- a/src/components/HelloWorld.vue +++ /dev/null @@ -1,43 +0,0 @@ - - - - - diff --git a/src/components/Qrcode.vue b/src/components/Qrcode.vue new file mode 100644 index 0000000..322ce61 --- /dev/null +++ b/src/components/Qrcode.vue @@ -0,0 +1,102 @@ + + + + + \ No newline at end of file diff --git a/src/components/TextTruncate.vue b/src/components/TextTruncate.vue new file mode 100644 index 0000000..982ea3e --- /dev/null +++ b/src/components/TextTruncate.vue @@ -0,0 +1,47 @@ + + + + + + \ No newline at end of file diff --git a/src/components/layout/AdminLayout.vue b/src/components/layout/AdminLayout.vue new file mode 100644 index 0000000..f983e31 --- /dev/null +++ b/src/components/layout/AdminLayout.vue @@ -0,0 +1,282 @@ + + + + + \ No newline at end of file diff --git a/src/components/layout/Breadcrumb.vue b/src/components/layout/Breadcrumb.vue new file mode 100644 index 0000000..639ffa3 --- /dev/null +++ b/src/components/layout/Breadcrumb.vue @@ -0,0 +1,125 @@ + + + + + \ No newline at end of file diff --git a/src/components/layout/SidebarMenuItem.vue b/src/components/layout/SidebarMenuItem.vue new file mode 100644 index 0000000..a88325d --- /dev/null +++ b/src/components/layout/SidebarMenuItem.vue @@ -0,0 +1,103 @@ + + + + + \ No newline at end of file diff --git a/src/components/layout/TagsView.vue b/src/components/layout/TagsView.vue new file mode 100644 index 0000000..d943a4c --- /dev/null +++ b/src/components/layout/TagsView.vue @@ -0,0 +1,366 @@ + + + + + \ No newline at end of file diff --git a/src/config/menus.js b/src/config/menus.js new file mode 100644 index 0000000..9ed7679 --- /dev/null +++ b/src/config/menus.js @@ -0,0 +1,49 @@ +export const menus = [ + { + path: '/dashboard', + title: '仪表盘', + icon: 'DataBoard' + }, + { + path : '/ticket', + title: '工单处理', + icon: 'DataBoard' + + }, + { + path: '/acs', + title: 'ACS管理', + icon: 'Monitor', + children: [ + { + path: '/acs/messages', + title: '消息管理', + children: [ + { path: '/acs/messages/announcements', title: '官方公告' }, + { path: '/acs/messages/policies', title: '官方政策' }, + { path: '/acs/messages/news', title: '新闻咨询' } + ] + }, + { + path: '/acs/images', + title: '镜像管理', + children: [ + { path: '/acs/images/vm', title: '虚拟机镜像' }, + { path: '/acs/images/container', title: '容器镜像' }, + { path: '/acs/images/categories', title: '镜像分类' } + ] + }, + { path: '/acs/nodes', title: '节点管理' } + ] + }, + { + path: '/system', + title: '系统管理', + icon: 'Setting', + children: [ + // { path: '/system/users', title: '用户管理' }, + // { path: '/system/operation-log', title: '操作日志' }, + { path: '/system/domain-whitelist', title: '域名白名单' } + ] + } +] \ No newline at end of file diff --git a/src/main.js b/src/main.js index b88abf1..3de95d3 100644 --- a/src/main.js +++ b/src/main.js @@ -2,10 +2,19 @@ import { createApp } from 'vue' import App from './App.vue' import router from './router' import ElementPlus from 'element-plus' +import * as ElementPlusIconsVue from '@element-plus/icons-vue' import 'element-plus/dist/index.css' import './style.css' +import {createPinia} from "pinia"; const app = createApp(App) + +// 注册所有图标 +for (const [key, component] of Object.entries(ElementPlusIconsVue)) { + app.component(key, component) +} +const pinia = createPinia() app.use(router) app.use(ElementPlus) -app.mount('#app') +app.use(pinia) +app.mount('#app') \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 172df83..7ecce2f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,20 +1,217 @@ import { createRouter, createWebHistory } from 'vue-router' -import Home from '../views/Home.vue' +import AdminLayout from '../components/layout/AdminLayout.vue' +import OperationLog from '@/views/system/OperationLog.vue' const routes = [ { path: '/', - name: 'Home', - component: Home, + redirect: '/dashboard' + }, + { + path: '/redirect', + component: AdminLayout, + hidden: true, + children: [ + { + path: '/redirect/:path(.*)', + component: () => import('../views/Redirect.vue'), + meta: { title: '重定向' } + } + ] + }, + { + path: '/', + component: AdminLayout, + children: [ + { + path: 'dashboard', + name: 'Dashboard', + component: () => import('../views/dashboard/Dashboard.vue'), + meta: { + title: '仪表盘', + icon: 'DataBoard' + } + }, + { + path: 'ticket', + name: 'Ticket', + meta: { + title: '工单管理', + icon: 'Tickets' + }, + component: () => import('../views/ticket/TicketChat.vue'), + }, + // ACS管理路由 + { + path: 'acs', + name: 'ACS', + meta: { + title: 'ACS管理', + icon: 'Monitor' + }, + redirect: '/acs/messages/announcements', + children: [ + // 消息管理路由 + { + path: 'messages', + name: 'Messages', + meta: { + title: '消息管理' + }, + redirect: '/acs/messages/announcements', + children: [ + { + path: 'announcements', + name: 'Announcements', + component: () => import('../views/acs/messages/Announcements.vue'), + meta: { + title: '官方公告' + } + }, + { + path: 'policies', + name: 'Policies', + component: () => import('../views/acs/messages/Policies.vue'), + meta: { + title: '官方政策' + } + }, + { + path: 'news', + name: 'News', + component: () => import('../views/acs/messages/News.vue'), + meta: { + title: '新闻咨询' + } + } + ] + }, + // 镜像管理路由 + { + path: 'images', + name: 'Images', + meta: { + title: '镜像管理' + }, + redirect: '/acs/images/vm', + children: [ + { + path: 'vm', + name: 'VmImages', + component: () => import('../views/acs/images/VmImages.vue'), + meta: { + title: '虚拟机镜像' + } + }, + { + path: 'container', + name: 'ContainerImages', + component: () => import('../views/acs/images/ContainerImages.vue'), + meta: { + title: '容器镜像' + } + }, + { + path: 'categories', + name: 'ImageCategories', + component: () => import('../views/acs/images/ImageCategories.vue'), + meta: { + title: '镜像分类' + } + } + ] + }, + // 节点管理路由 + { + path: 'nodes', + name: 'Nodes', + component: () => import('../views/acs/nodes/Nodes.vue'), + meta: { + title: '节点管理' + } + } + ] + }, + { + path: 'system', + name: 'System', + meta: { + title: '系统管理', + icon: 'Setting' + }, + redirect: '/system/users', + children: [ + { + path: 'users', + name: 'Users', + component: () => import('../views/system/Users.vue'), + meta: { + title: '用户管理' + } + }, + { + path: 'operation-log', + name: 'OperationLog', + component: OperationLog, + meta: { title: '操作日志' } + }, + { + path: 'domain-whitelist', + name: 'DomainWhitelist', + component: () => import('../views/system/DomainWhitelist.vue'), + meta: { title: '域名白名单' } + } + ] + }, + // 个人中心路由 + { + path: 'profile', + name: 'Profile', + component: () => import('../views/profile/UserInfo.vue'), + meta: { + title: '个人信息', + hidden: true + } + }, + // 修改密码路由 + { + path: 'change-password', + name: 'ChangePassword', + component: () => import('../views/profile/ChangePassword.vue'), + meta: { + title: '修改密码', + hidden: true + } + }, + // 服务器详情页面路由 + { + path: 'servers/server', + name: 'ServerDetail', + component: () => import('../views/acs/nodes/server.vue'), + meta: { + title: '服务器详情', + hidden: true + } + } + ] + }, + // 登录页 + { + path: '/login', + name: 'Login', + component: () => import('../views/Login.vue'), meta: { - title: '首页' + title: '登录' } }, // 404 页面 { path: '/:pathMatch(.*)*', name: 'NotFound', - component: () => import('../views/NotFound.vue') + component: () => import('../views/NotFound.vue'), + meta: { + title: '页面不存在' + } } ] @@ -26,12 +223,19 @@ const router = createRouter({ // 全局前置守卫 router.beforeEach((to, from, next) => { // 设置页面标题 - document.title = to.meta.title || '默认标题' - next() + document.title = to.meta.title ? `${to.meta.title} - 007UI管理系统` : '007UI管理系统' + + // 这里可以添加登录验证逻辑 + const isAuthenticated = localStorage.getItem('token') + if (to.path !== '/login' && !isAuthenticated) { + next({ path: '/login' }) + } else { + next() + } }) // 全局后置钩子 -router.afterEach((to, from) => { +router.afterEach(() => { window.scrollTo(0, 0) }) diff --git a/src/store/userStore.js b/src/store/userStore.js new file mode 100644 index 0000000..87f521f --- /dev/null +++ b/src/store/userStore.js @@ -0,0 +1,14 @@ +import {defineStore} from "pinia"; +import {ref} from "vue"; + + +export const useUserStore = defineStore('userStore',() => { + + let userInfo = ref({}) + + function setUserInfo(u){ + userInfo.value = u + } + + return {userInfo,setUserInfo} +}) \ No newline at end of file diff --git a/src/style.css b/src/style.css index cca57b3..222de0c 100644 --- a/src/style.css +++ b/src/style.css @@ -1,5 +1,140 @@ +/* 全局样式 */ * { margin: 0; padding: 0; box-sizing: border-box; } + +html, body { + height: 100%; + width: 100%; +} + +body { + font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + font-size: 14px; + color: #303133; + background-color: #f5f7fa; +} + +#app { + height: 100%; +} + +/* 常用工具类 */ +.text-primary { + color: #1890ff; +} + +.text-success { + color: #52c41a; +} + +.text-warning { + color: #faad14; +} + +.text-danger { + color: #f5222d; +} + +.text-info { + color: #909399; +} + +.text-center { + text-align: center; +} + +.text-left { + text-align: left; +} + +.text-right { + text-align: right; +} + +.flex { + display: flex; +} + +.flex-column { + flex-direction: column; +} + +.justify-center { + justify-content: center; +} + +.justify-between { + justify-content: space-between; +} + +.items-center { + align-items: center; +} + +.w-full { + width: 100%; +} + +.h-full { + height: 100%; +} + +.mb-10 { + margin-bottom: 10px; +} + +.mt-10 { + margin-top: 10px; +} + +.mr-10 { + margin-right: 10px; +} + +.ml-10 { + margin-left: 10px; +} + +.p-10 { + padding: 10px; +} + +.py-10 { + padding-top: 10px; + padding-bottom: 10px; +} + +.px-10 { + padding-left: 10px; + padding-right: 10px; +} + +/* 响应式工具类 */ +@media (max-width: 768px) { + .hidden-xs { + display: none !important; + } +} + +@media (min-width: 768px) and (max-width: 992px) { + .hidden-sm { + display: none !important; + } +} + +@media (min-width: 992px) and (max-width: 1200px) { + .hidden-md { + display: none !important; + } +} + +@media (min-width: 1200px) { + .hidden-lg { + display: none !important; + } +} diff --git a/src/utils/acs/audit.js b/src/utils/acs/audit.js new file mode 100644 index 0000000..dc84395 --- /dev/null +++ b/src/utils/acs/audit.js @@ -0,0 +1,23 @@ +import {http2} from "@/utils/request.js"; + + +/**获取所有站点 */ +export const getSiteList = (data) => { + return http2.get(`/v1/admin/audit/list?page=${data.page}&count=${data.count}&key=${data.key}`) +} +/**手动触发站点审计 */ +export const auditSite = () => { + return http2.get(`/v1/admin/audit/start`) +} +/**删除违规网页审计 */ +export const delAudit = (data) => { + return http2.post(`/v1/admin/audit/delete`,data,{ + headers: { + 'Content-Type': 'multipart/form-data' + } + }) +} +/**获取违规网页审计列表 */ +export const getAuditList = (data) => { + return http2.get(`/v1/admin/audit/violation_list?page=${data.page}&count=${data.count}&key=${data.key}`) +} diff --git a/src/utils/acs/message.js b/src/utils/acs/message.js new file mode 100644 index 0000000..c6f4402 --- /dev/null +++ b/src/utils/acs/message.js @@ -0,0 +1,116 @@ +import {http2} from "@/utils/request.js"; +/**获取消息列表 */ +export const getMessageList = (data) => { + return http2.get(`/v1/messages/get_message_list?page=${data.page}&count=${data.count}&message_type=${data.message_type}`) +} +/**获取单条消息 */ +export const getMessage = (data) => { + return http2.get(`/v1/messages/get_message?message_id=${data}`) +} +/**添加消息 */ +export const addMessage = (data) => { + return http2.post(`/v1/messages/add_message`, data,{ +headers: { +'Content-Type': 'multipart/form-data' +} +}) +} +/**删除消息 */ +export const deleteMessage = (data) => { + return http2.post(`/v1/messages/delete_message`, data,{ +headers: { +'Content-Type': 'multipart/form-data' +} +}) +} +/**修改消息 */ +export const editMessage = (data) => { + return http2.post(`/v1/messages/update_message`, data,{ +headers: { +'Content-Type': 'multipart/form-data' +} +}) +} +/**获取附件列表 */ +export const getFileList = (data) => { + return http2.get(`/v1/attachment/get_attachment_list?page=${data.page}&count=${data.count}&key=${data.key}&user_type=${data.user_type}`) +} +/**上传附件 */ +export const uploadFile = (data) => { + return http2.post(`/v1/attachment/add_attachment`, data,{ +headers: { +'Content-Type': 'multipart/form-data' +} +}) +} +/**删除附件 */ +export const deleteFile = (data) => { + return http2.get(`/v1/attachment/delete_attachment?aid=${data}`) +} +/**用户获取消息列表 */ +export const getUserMessageList = (data) => { + return http2.get(`/v1/messages/get_message_list?page=${data.page}&count=${data.count}&message_type=${data.message_type}`) +} +/**用户获取单条消息 */ +export const getUserMessage = (data) => { + return http2.get(`/v1/messages/get_message?message_id=${data}`) +} + +/**获取消息详情 */ +export const getMessageDetail = (data) => { + return http2.get(`/v1/messages/get_message?message_id=${data.message_id}`) +} +/**修改图片大小 */ +export const compressAndConvertFileToBase64=async(file)=> { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + + reader.onload = function(e) { + const img = new Image(); + img.src = e.target.result; + + img.onload = function() { + const canvas = document.createElement('canvas'); + const MAX_WIDTH = 300; // 压缩的最大宽度 + const MAX_HEIGHT = 200; // 压缩的最大高度 + + let width = img.width; + let height = img.height; + + // 计算压缩比例 + if (width > height) { + if (width > MAX_WIDTH) { + height *= MAX_WIDTH / width; + width = MAX_WIDTH; + } + } else { + if (height > MAX_HEIGHT) { + width *= MAX_HEIGHT / height; + height = MAX_HEIGHT; + } + } + + canvas.width = width; + canvas.height = height; + + const ctx = canvas.getContext('2d'); + ctx.drawImage(img, 0, 0, width, height); + + // 将canvas内容转换为jpeg并压缩质量 + const dataUrl = canvas.toDataURL('image/jpeg', 0.8); // 0.8是压缩质量,范围0-1 + + resolve(dataUrl); + }; + + img.onerror = function(error) { + reject(error); + }; + }; + + reader.onerror = function(error) { + reject(error); + }; + + reader.readAsDataURL(file); + }); +} \ No newline at end of file diff --git a/src/utils/acs/mirror.js b/src/utils/acs/mirror.js new file mode 100644 index 0000000..f5b5c12 --- /dev/null +++ b/src/utils/acs/mirror.js @@ -0,0 +1,93 @@ +import {http2} from "@/utils/request.js"; +/**获取镜像列表 */ +export const getMirrorList = data => { + return http2.get(`/v1/image/list?server_id=${data}`); +}; +/*用户获取镜像列表 */ +export const getUserMirrorList = data => { + return http2.get( + `/v1/image/list?server_id=${data.server_id}&count=${data.count}&page=${data.page}&key=${data.key}` + ); +}; +/**上传镜像 */ +export const uploadMirror = data => { + return http2.post("/v1/image/pull", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**编辑镜像 */ +export const editMirror = data => { + return http2.post("/v1/image/update", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**删除镜像 */ +export const delMirror = data => { + return http2.post("/v1/image/delete", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**镜像同步 */ +export const syncMirror = data => { + return http2.get(`/v1/image/sync?server_id=${data}`); +}; +/**重新拉取镜像 */ +export const pullMirror = data => { + return http2.post(`/v1/image/repull`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; + +/**获取镜像信息 */ +export const Mirrorinfo = data => { + const serverType = data.server_type || "dockerContainer"; // 设置默认值 + return http2.get( + `/v1/image/info?image_id=${data.image_id}&server_type=${serverType}` + ); +}; + +export const addVirtualMirror = data => { + return http2.post("/v1/image/create", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; + + +export const getImageTypeList = (server_id) => { + return http2.get(`/v1/image/class_list?server_id=${server_id}`); +}; + +export const createImageType = (server_id,class_name,class_ico) => { + return http2.post("/v1/image/class_create", { + server_id, + class_name, + class_ico + },{ + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; + +export const updateImageType = (class_id,class_name,class_ico) => { + return http2.post("/v1/image/class_update", { + class_id, + class_name, + class_ico + },{ + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; + diff --git a/src/utils/acs/order.js b/src/utils/acs/order.js new file mode 100644 index 0000000..1e37294 --- /dev/null +++ b/src/utils/acs/order.js @@ -0,0 +1,25 @@ +import {http2} from "@/utils/request.js"; +/**获取订单列表 */ +export const getOrderList = (data) => { + return http2.get(`/v1/admin/trades/get_trades?page=${data.page}&count=${data.count}&key=${data.key}`) +} +/**编辑订单 */ +export const editOrder = (data) => { + return http2.post('/v1/admin/trades/update_trades',data,{ +headers: { +'Content-Type': 'multipart/form-data' +} +}) +} +/**删除订单 */ +export const deleteOrder = (data) => { + return http2.post('/v1/admin/trades/delete_trade',data,{ +headers: { +'Content-Type': 'multipart/form-data' +} +}) +} +/**用户获取订单列表 */ +export const getUserOrderList = (data) => { + return http2.get(`/v1/user/procedure/get_trade_list?page=${data.page}&count=${data.count}&key=${data.key}`) +} \ No newline at end of file diff --git a/src/utils/acs/pay.js b/src/utils/acs/pay.js new file mode 100644 index 0000000..8246250 --- /dev/null +++ b/src/utils/acs/pay.js @@ -0,0 +1,32 @@ +import {http2} from "@/utils/request.js"; +/**获取用户列表 */ +export const get_pay_code = data => { + return http2.get( + `https://yun.tdhly.love/submit.php?pid=2&type=${data.type}&out_trade_no={商户订单号}¬ify_url={服务器异步通知地址}&name={商品名称}&money=${data.money}&sign=9vP6xvcc93YYi9c6F3HiY9HFuyZizIxe&sign_type=MD5` + ); +}; +// /**email验证码 */ +// export const ask_update_user_email = data => { +// return http2.post("/v1/user/info/ask_update_user_email", data, { +// headers: { +// "Content-Type": "multipart/form-data" +// } +// }); +// }; +/**获取容器订单金额 */ +export const procedure_get_price = data => { + return http2.post("/v1/user/procedure/get_price", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; + +/**获取虚拟机订单金额 */ +export const procedure_vir_price = data => { + return http2.post("/v1/user/procedure/get_vm_price", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; diff --git a/src/utils/acs/server.js b/src/utils/acs/server.js new file mode 100644 index 0000000..cf06925 --- /dev/null +++ b/src/utils/acs/server.js @@ -0,0 +1,455 @@ +import {http2} from "@/utils/request.js"; + +/** 获取所有服务器 */ +export const getServer = (page, count, key, type = "dockerContainer") => { + return http2.get( + `/v1/admin/server/get_server_list?page=${page}&count=${count}&key=${key}&server_type=${type}` + ); +}; + +/**新增服务器 */ +export const addServer = data => { + return http2.post("/v1/admin/server/add_server", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**编辑服务器 */ +export const editServer = data => { + return http2.post("/v1/admin/server/update_server", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**删除服务器 */ +export const deleteServer = data => { + return http2.post("/v1/admin/server/delete_server", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**查询指定服务器 */ +export const selectServer = data => { + return http2.post("/v1/admin/server/select_server", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**获取服务器套餐列表*/ +export const getServerPlan = data => { + return http2.get( + `/v1/admin/container_plan/get_server_plan_list?server_id=${data.server_id}&count=${data.count}` + ); +}; +/**获取指定套餐 */ +export const selectServerPlan = data => { + return http2.post("/v1/admin/container_plan/get_server_plan_detail", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**修改套餐信息 */ +export const editServerPlan = data => { + return http2.post("/v1/admin/container_plan/update_server_plan", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**新增套餐 */ +export const addServerPlan = data => { + return http2.post("/v1/admin/container_plan/add_server_plan", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**删除套餐 */ +export const deleteServerPlan = data => { + return http2.post("/v1/admin/container_plan/delete_server_plan", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**获取容器列表 */ +export const getContainer = data => { + return http2.get( + `/v1/admin/container/get_container_list?server_id=${data.server_id}&user_id=${data.user_id}&page=${data.page}&count=${data.count}&key=${data.key}` + ); +}; +/**获取单个指定容器 */ +export const getOneContainer = data => { + return http2.post("/v1/admin/container/get_container_detail", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**查询指定虚拟机信息(管理员查询) */ +export const getVmAdminContainer = id => { + return http2.get(`/v1/admin/instance/detail/${id}`); +}; +// 暂停容器 +export const pauseContainer = data => { + return http2.post("/v1/admin/container/pause_container", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +// 暂停虚拟机 +export const pauseInstance = (data, id) => { + return http2.post(`/v1/admin/instance/pause/${id}`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**恢复虚拟机 */ +export const unpauseInstance = (id, data = "") => { + return http2.post(`/v1/admin/instance/resume/${id}`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; + +// 解除暂停 +export const unpauseContainer = data => { + return http2.post("/v1/admin/container/unpause_container", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**获取容器状态 */ +export const getContainerStatus = data => { + return http2.post("/v1/admin/container/get_container_status", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**获取虚拟机状态 */ +export const getInstanceStatus = id => { + return http2.get(`/v1/admin/instance/get_state/${id}`); +}; +/**查询服务器状态 */ +export const getServerStatus = id => { + return http2.get(`/v1/admin/server/send_server_status?server_id=${id}`); +}; +/**开通容器 */ +export const openContainer = data => { + return http2.post("/v1/admin/container/open_container", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**开通虚拟机 */ +export const openInstance = (id, data = "") => { + return http2.post(`/v1/admin/instance/approve/${id}`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**启动容器 */ +export const startContainer = data => { + return http2.post("/v1/admin/container/start_container", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**启动虚拟机 */ +export const startInstance = data => { + return http2.get(`/v1/admin/instance/start/${data}`); +}; +/**重装容器 */ +export const reinstallC = data => { + return http2.post("/v1/admin/container/reinstall_container", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**重装虚拟机 */ +export const reinstallI = (data, id) => { + return http2.post(`/v1/admin/instance/reinstall/${id}`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; + +/**获取容器日志 */ +export const getContainerLog = data => { + return http2.post(`/v1/admin/container/get_container_log`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**获取虚拟机操作日志 */ +export const getInstanceLog = (id, data) => { + return http2.get( + `/v1/admin/instance/log/${id}?page=${data.page}&count=${data.count}` + ); +}; + +/**重启容器 */ +export const restartContainer = data => { + return http2.post("/v1/admin/container/reboot_container", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**重启虚拟机 */ +export const restartInstance = data => { + return http2.get(`/v1/admin/instance/reboot/${data}`); +}; + +/**停止容器 */ +export const stopContainer = data => { + return http2.post("/v1/admin/container/stop_container", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**停止虚拟机 */ +export const stopInstance = data => { + return http2.get(`/v1/admin/instance/stop/${data}`); +}; + +/**删除容器 */ +export const deleteContainer = data => { + return http2.post("/v1/admin/container/delete_container", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**删除虚拟机 */ +export const deleteInstance = (id, data = "") => { + return http2.post(`/v1/admin/instance/delete/${id}`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**清除容器流量 */ +export const clearContainerTraffic = data => { + return http2.post("/v1/admin/container/clear_container_traffic", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**连接控制台 */ +export const connectConsole = data => { + return http2.post("/v1/admin/container/get_container_console", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**获取虚拟机控制台 */ +export const getInstanceConsole = data => { + return http2.get(`/v1/admin/instance/console/${data}`); +}; +/**查询容器所有卷信息 */ +export const getVolumeList = data => { + return http2.get(`/v1/admin/volume/get_volume_list?container_id=${data}`); +}; +/**查询虚拟机所有卷信息 */ +export const getInstanceVolumeList = data => { + return http2.get( + `/v1/admin/volume/get_volume_list?instance_id=${data.instance_id}&page=${data.page}&count=${data.count}` + ); +}; +/**新增卷 */ +export const addVolume = data => { + return http2.post("/v1/admin/volume/add_volume", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**修改卷大小 */ +export const updateVolume = data => { + return http2.post("/v1/admin/volume/update_volume_size", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**删除数据卷 */ +export const deleteVolume = data => { + return http2.post("/v1/admin/volume/delete_volume", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**获取容器网络信息 */ +export const getNetworkList = data => { + return http2.get( + `/v1/container/proxy/get_container_proxy?container_id=${data}` + ); +}; +/**获取虚拟机端口列表 */ +export const getInstancePortList = data => { + const params = new URLSearchParams(); + if (data.page !== undefined) params.append("page", data.page.toString()); + if (data.count !== undefined) params.append("count", data.count.toString()); + if (data.internal_port !== undefined) + params.append("internal_port", data.internal_port.toString()); + return http2.get( + `/v1/admin/instance_port/list?instance_id=${data.instance_id}&${params.toString()}` + ); +}; +/**添加容器网络 */ +export const addNetwork = data => { + return http2.post("/v1/container/proxy/add_container_proxy", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**创建端口 */ +export const addPort = data => { + return http2.post("/v1/admin/instance_port/create", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**获取浮动ip列表 */ +export const getFloatingIpList = data => { + return http2.get( + `/v1/admin/floating_ip/get_list?server_id=${data.server_id}&page=${data.page}&count=${data.count}` + ); +}; +/**新增浮动ip */ +export const addFloatingIp = data => { + return http2.post("/v1/admin/floating_ip/add", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**批量添加浮动ip */ +export const addFloatingIpBatch = data => { + return http2.post("/v1/admin/floating_ip/add_list", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**删除浮动ip */ +export const delFloatingIp = data => { + return http2.post("/v1/admin/floating_ip/delete", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; + +/**获取单个用户操作日志 */ +export const getUserLog = data => { + return http2.get( + `/v1/user/procedure/get_user_log?user_id=${data.user_id}&page=${data.page}&count=${data.count}` + ); +}; + +/**管理员修改头像 */ +export const editAvatar = data => { + return http2.post("/v1/admin/users/upload_user_avatar", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; + +/**获取服务器硬盘信息 */ +export const getDiskInfo = data => { + return http2.get(`/v1/admin/server/get_server_disk?server_id=${data}`); +}; +/**获取服务器实际划分硬盘信息 */ +export const getRealDisk = data => { + return http2.get(`/v1/admin/server/get_server_disk_info?server_id=${data}`); +}; +/**获取服务器流量信息 */ +export const getTraffic = data => { + return http2.get(`/v1/admin/server/get_server_bandwidth?server_id=${data}`); +}; +/**获取版本更新 */ +export const getVersion = () => { + return http2.get(`/v1/admin/version`); +}; + +// 管理员删除https网络 +export const AdminDelHttps = data => { + return http2.post("/v1/container/proxy/del_https_connet", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; + +// 管理员添加https网络 +export const AdminAddHttps = data => { + return http2.post("/v1/container/proxy/add_https_proxy", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**获取指定端口信息 */ +export const getPortInfo = data => { + return http2.get(`/v1/admin/instance_port/detail?port_id=${data}`); +}; +/**新增卷 */ +export const addVolumeMount = data => { + return http2.post("/v1/admin/volume/add_volume", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; + +/**进入救援系统 */ +export const rescueInstance = id => { + return http2.get(`/v1/admin/instance/rescue/enter/${id}`); +}; + +/**退出救援系统 */ +export const exitRescueInstance = id => { + return http2.get(`/v1/admin/instance/rescue/exit/${id}`); +}; + +/**修改虚拟机密码 */ +export const changeInstancePassword = (id, data) => { + return http2.post(`/v1/admin/instance/update_password/${id}`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**修改虚拟机密码(用户) */ +export const changeInstancePasswordUser = (id, data) => { + return http2.post(`/v1/user/instance/update_password/${id}`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; diff --git a/src/utils/acs/setting.js b/src/utils/acs/setting.js new file mode 100644 index 0000000..1df40b0 --- /dev/null +++ b/src/utils/acs/setting.js @@ -0,0 +1,40 @@ +import {http2} from "@/utils/request.js"; +/**获取全局配置 */ +export const getSetting = () => { + return http2.get('/v1/admin/settings/get_settings') +} +/**变更设置 */ +export const updateSetting = (data) => { + return http2.post('/v1/admin/settings/update_settings', data, { + headers: { + 'Content-Type': 'multipart/form-data' + } + }) +} +/**新增设置 */ +export const addSetting = (data) => { + return http2.post('/v1/admin/settings/add_settings', data, { + headers: { + 'Content-Type': 'multipart/form-data' + } + }) +} +/**删除设置 */ +export const deleteSetting = (data) => { + return http2.post('/v1/admin/settings/delete_settings', data,{ + headers: { + 'Content-Type': 'multipart/form-data' + } + }) +} +/**获取单项配置 */ +export const getOneSetting = (data) => { + return http2.get(`/v1/admin/settings/get_setting?name=${data}`) +} +/**获取多个配置 */ +export const getSettings = (data) => { + // return http2.get(`/v1/admin/settings/get_settings?names=${data}`); + const namesParam = data.join(','); + // 将处理后的namesParam放入URL中 + return http2.get(`/v1/admin/settings/get_setting?names=${encodeURIComponent(namesParam)}`); +} \ No newline at end of file diff --git a/src/utils/acs/user-set.js b/src/utils/acs/user-set.js new file mode 100644 index 0000000..840cdd9 --- /dev/null +++ b/src/utils/acs/user-set.js @@ -0,0 +1,45 @@ +import {http2} from "@/utils/request.js"; +/**获取用户列表 */ +export const ask_update_user_email11 = data => { + return http2.get(`/v1/user/info/ask_update_user_email?email=${data.email}`); +}; +/**email验证码 */ +export const ask_update_user_email = data => { + return http2.post("/v1/user/info/ask_update_user_email", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**email修改 */ +export const update_user_email = data => { + return http2.post("/v1/user/info/update_user_email", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**phone验证码 */ +export const ask_update_user_phone = data => { + return http2.post("/v1/user/info/ask_update_user_phone", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**phone修改 */ +export const update_user_phone = data => { + return http2.post("/v1/user/info/update_user_phone", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**密码修改 */ +export const update_user_password = data => { + return http2.post("/v1/user/info/update_user_password", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; diff --git a/src/utils/acs/user.js b/src/utils/acs/user.js new file mode 100644 index 0000000..e3980e9 --- /dev/null +++ b/src/utils/acs/user.js @@ -0,0 +1,501 @@ + +import {http2} from "@/utils/request.js"; +// import { getUserContainer } from './user'; + +// 获取图像验证码 +export const Captch = data => { + return http2.get(`/v1/user/check/get_code_img`); +}; + +/** 登录 */ +export const getLogin = data => { + return http2.post("/v1/user/login", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; + +// // /** 刷新token */ +// export const refreshTokenApi = (data?: object) => { +// return http.request("post", "/refresh-token", { data }); +// }; + +/**获取用户列表 */ +export const getUserList = data => { + return http2.get( + `/v1/admin/users/get_user_list?page=${data.page}&count=${data.count}&key=${data.key}` + ); +}; +/**添加用户 */ +export const addUser = data => { + return http2.post("/v1/admin/users/add_user", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**编辑用户信息 */ +export const editUser = data => { + return http2.post("/v1/admin/users/update_user", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**修改用户密码 */ +export const editPassword = data => { + return http2.post("/v1/admin/users/update_user_password", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**删除用户 */ +export const deleteUser = data => { + return http2.post("/v1/admin/users/del_user", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**查询单个用户 */ +export const userDetail = data => { + return http2.post("/v1/admin/users/select_user", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**修改用户余额 */ +export const editBalance = data => { + return http2.post("/v1/admin/users/update_user_balance", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**获取用户服务器 */ +export const getUserServer = (data = {}) => { + const serverType = data.server_type || "dockerContainer"; // 设置默认值 + return http2.get( + `/v1/user/procedure/get_server_list?server_type=${serverType}` + ); +}; +/**用户获取虚拟机列表 */ +export const getVirtualList = data => { + let url = `/v1/user/instance/list?page=${data.page}&count=${data.count}`; + if (data.key) { + url += `&key=${data.key}`; + } + if (data.server_id) { + url += `&server_id=${data.server_id}`; + } + return http2.get(url); +}; +/**用户获取服务器套餐 */ +export const getUserPackage = data => { + return http2.get(`/v1/user/procedure/get_server_plan_list?server_id=${data}`); +}; +/**获取用户容器列表 */ +export const getUserContainer = data => { + return http2.get( + `/v1/user/container/list?page=${data.page}&count=${data.count}` + ); +}; +/**用户按地区获取容器 */ +export const getUserContainerD = data => { + return http2.get( + `/v1/user/container/list?page=${data.page}&count=${data.count}&server_id=${data.server_id}` + ); +}; +/**获取用户操作日志 */ +export const get_user_log = () => { + return http2.get(`/v1/user/procedure/get_user_log`); +}; +/**获取用户自身信息 */ +export const getUserInfo = () => { + return http2.get(`/v1/user/procedure/get_user_info`); +}; +/**获取用户自身信息 */ +export const getUserInfoV1 = () => { + return http2.get(`/v1/user/info/get_user_info`); +}; +/**用户实名 */ +export const realName = data => { + return http2.post("/v1/external/real_name", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**发送手机验证码 */ +export const sendCode = data => { + return http2.post("/v1/external/send_message", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**发送邮箱验证码 */ +export const sendEmailCode = data => { + return http2.post("/v1/external/send_email", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**用户注册 */ +export const register = data => { + return http2.post("/v1/user/register", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**手机号修改校证码 */ +export const CodePhone = data => { + return http2.post("/v1/user/info/ask_update_user_phone", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**修改手机号码 */ +export const SetPhone = data => { + return http2.post("/v1/user/info/update_user_phone", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**邮箱修改校证码 */ +export const CodeEmail = data => { + return http2.post("/v1/user/info/ask_update_user_email", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**修改邮箱 */ +export const SetEmail = data => { + return http2.post("/v1/user/info/update_user_email", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**上传头像 */ +export const uploadAvatar = data => { + return http2.post("/v1/user/info/upload_user_avatar", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**手机号忘记密码 */ +export const forgetphone = data => { + return http2.post("/v1/user/info/forget_user_password_phone", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; + +/**邮箱忘记密码 */ +export const forgetemail = data => { + return http2.post("/v1/user/info/forget_user_password_email", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**管理员全局搜索 */ +export const Find = data => { + return http2.post("/v1/admin/search", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +// 管理员删除容器网络 +export const delContainer = data => { + return http2.post("/v1/user/container/delete_connect", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +// 删除端口 +export const delPort = data => { + return http2.post("/v1/admin/instance_port/delete", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +// 自定义容器价格 +export const Containerpay = data => { + return http2.post("/v1/admin/container/update_container_price", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +// 修改虚拟机续费价格 +export const Containerpaytime = (data, id) => { + return http2.post(`/v1/admin/instance/update_price/${id}`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +// 自定义容器到期时间 +export const Containertime = data => { + return http2.post("/v1/admin/container/update_container_expire_time", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +// 修改虚拟机续到期时间 +export const Containertimetime = (data, id) => { + return http2.post(`/v1/admin/instance/update_expire_time/${id}`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +// 修改虚拟机信息 +export const editContainer = (data, id) => { + return http2.post(`/v1/admin/instance/update/${id}`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; + +/***************************************容器管理 ************************/ + +/** 容器操作 */ +export const startUserContainer = (type, id) => { + return http2.post( + "/v1/user/container/" + type, + { + container_id: id + }, + { + headers: { + "Content-Type": "multipart/form-data" + } + } + ); +}; +/**用户容器退款 */ +export const backUserContainer = data => { + return http2.post("/v1/user/container/delete", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**重装容器 */ +export const reinContainer = data => { + return http2.post("/v1/user/container/reinstall", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**重装虚拟机 */ +export const reinVmContainer = (id, data) => { + return http2.post(`/v1/user/instance/reinstall/${id}`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/** 容器操作 */ +export const startAdminContainer = (type, id) => { + return http2.post( + "/v1/admin/container/" + type, + { + container_id: id + }, + { + headers: { + "Content-Type": "multipart/form-data" + } + } + ); +}; +/** 容器操作 */ +export const procedureUpdateContainerRenew = data => { + return http2.post("/v1/user/procedure/update_container_renew", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**获取容器完整信息 */ +export const getContainerDetail = id => { + return http2.get(`/v1/user/container/detail?container_id=${id}`); +}; +/**获取虚拟机完整信息 */ +export const getVmContainerDetail = id => { + return http2.get(`/v1/user/instance/detail/${id}`); +}; +/**容器操作信息 */ +export const containerLog = data => { + return http2.post("/v1/user/container/logs", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**虚拟机操作日志 */ +export const vmLog = data => { + return http2.get( + `/v1/user/instance/log/${data.id}?page=${data.page}&count=${data.count}` + ); +}; +/**获取容器状态 */ +export const getContainerStatus = data => { + return http2.post(`/v1/user/container/status`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**获取虚拟机状态 */ +export const getVmStatus = id => { + return http2.get(`/v1/user/instance/get_state/${id}`); +}; +/**获取容器运行日志 */ +export const getContainerLog = data => { + return http2.post(`/v1/user/container/run_logs`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**获取容器购买网络订单 */ +export const getContainerList = data => { + return http2.post(`/v1/user/procedure/add_network`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**计算容器网络价格 */ +export const getContainerPrice = data => { + return http2.post(`/v1/user/procedure/get_price_network`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/** 启动虚拟机 */ +export const start_vm = id => { + return http2.get(`/v1/user/instance/start/${id}`); +}; +/** 停止虚拟机(关机) */ +export const stop_vm = id => { + return http2.get(`/v1/user/instance/stop/${id}`); +}; +/**重启虚拟机 */ +export const restart_vm = id => { + return http2.get(`/v1/user/instance/reboot/${id}`); +}; +/**获取虚拟机控制台 */ +export const get_vm_console = id => { + return http2.get(`/v1/user/instance/console/${id}`); +}; +/**进入救援系统 */ +export const rescue_vm = id => { + return http2.get(`/v1/user/instance/rescue/enter/${id}`); +}; +/**退出救援系统 */ +export const unrescue_vm = id => { + return http2.get(`/v1/user/instance/rescue/exit/${id}`); +}; + +// ******************************* new +/** 提交充值订单 */ +export const user_update_container_recharge = data => { + return http2.post("/v1/user/procedure/update_container_recharge", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/** 提交容器订单 */ +export const user_update_plan_info = data => { + return http2.post("/v1/user/procedure/update_plan_info", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/** 提交虚拟机订单 */ +export const user_update_vm_info = data => { + return http2.post("/v1/user/procedure/create_vm_trade", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**获取订单简略信息 */ +export const getOrderDetail = id => { + return http2.get(`/v1/user/procedure/get_low_trade_info?trade_id=${id}`); +}; +/**支付请求 */ +export const pay_request = data => { + return http2.post("/v1/external/pay", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**用户删除容器网络 */ +export const deleteConNet = data => { + return http2.post("/v1/user/container/delete_connect", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; + +// 添加https +export const additionHttp = data => { + return http2.post("/v1/user/container/add_https_connet", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; + +// 删除https +export const DelHttp = data => { + return http2.post("/v1/user/container/del_https_connet", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**获取新增虚拟机端口价格 */ +export const getVmPortPrice = data => { + return http2.post("/v1/user/procedure/get_price_instance_port", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**提交新增虚拟机端口订单 */ +export const addVmPort = data => { + return http2.post("/v1/user/procedure/add_instance_port", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; diff --git a/src/utils/acs/virtual.js b/src/utils/acs/virtual.js new file mode 100644 index 0000000..b3e4522 --- /dev/null +++ b/src/utils/acs/virtual.js @@ -0,0 +1,171 @@ +import {http2} from "@/utils/request.js"; + + +/**获取虚拟机列表 */ +export const getVirtualList = data => { + let url = `/v1/admin/instance/list?page=${data.page}&count=${data.count}`; + if (data.key) { + url += `&key=${data.key}`; + } + if (data.user_id) { + url += `&user_id=${data.user_id}`; + } + if (data.server_id) { + url += `&server_id=${data.server_id}`; + } + return http2.get(url); +}; + +/**新增虚拟机 */ +export const addVirtual = data => { + return http2.post("/v1/admin/instance/create_vm", data); +}; + +/**迁移数据卷 */ +export const migrate_disk = data => { + return http2.post("/v1/admin/volume/migrate_volume", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; + +/**获取虚拟机访问控制列表 */ +export const getVirtualAccessList = data => { + let url = `/v1/admin/instance/access_control/list?page=${data.page}&count=${data.count}&instance_id=${data.instance_id}`; + return http2.get(url); +}; +/**获取虚拟机访问控制列表(用户) */ +export const getUserAccessList = data => { + let url = `/v1/user/instance/access_control/list?page=${data.page}&count=${data.count}&instance_id=${data.instance_id}`; + return http2.get(url); +}; + +/**创建访问控制 */ +export const createAccessControl = data => { + return http2.post("/v1/admin/instance/access_control/create", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**创建访问控制(用户) */ +export const createUserAccessControl = data => { + return http2.post("/v1/user/instance/access_control/create", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**删除访问控制 */ +export const deleteAccessControl = data => { + return http2.post("/v1/admin/instance/access_control/delete", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**删除访问控制(用户) */ +export const deleteUserAccessControl = data => { + return http2.post("/v1/user/instance/access_control/delete", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; + +/**获取虚拟机快照列表 */ +export const getSnapshotList = data => { + let url = `/v1/admin/instance/snapshot/list/${data.instance_id}?page=${data.page}&count=${data.count}`; + return http2.get(url); +}; +/**获取虚拟机快照列表(用户) */ +export const getUserSnapshotList = data => { + let url = `/v1/user/instance/snapshot/list/${data.instance_id}?page=${data.page}&count=${data.count}`; + return http2.get(url); +}; +/**创建虚拟机快照 */ +export const createSnapshot = (data, id) => { + return http2.post(`/v1/admin/instance/snapshot/create/${id}`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**创建虚拟机快照(用户) */ +export const createUserSnapshot = (data, id) => { + return http2.post(`/v1/user/instance/snapshot/create/${id}`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; + +/**删除虚拟机快照 */ +export const deleteSnapshot = (data, id) => { + return http2.post(`/v1/admin/instance/snapshot/delete/${id}`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; + +/**恢复虚拟机快照 */ +export const recoverSnapshot = (data, id) => { + return http2.post(`/v1/admin/instance/snapshot/restore/${id}`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**恢复虚拟机快照(用户) */ +export const recoverUserSnapshot = (data, id) => { + return http2.post(`/v1/user/instance/snapshot/restore/${id}`, data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +/**获取实时监控 */ +export const getVirtualLog = data => { + return http2.get( + `/v1/admin/instance/run_logs/${data.id}?start_time=${data.start_time}&end_time=${data.end_time}` + ); +}; +/**获取实时监控(用户) */ +export const getUserVirtualLog = data => { + return http2.get( + `/v1/user/instance/run_logs/${data.id}?start_time=${data.start_time}&end_time=${data.end_time}` + ); +}; + +/**获取新增虚拟机快照数量价格 */ +export const getSnapshotPrice = data => { + return http2.get(`/v1/user/procedure/get_price_snapshot?num=${data}`); +}; + +/**提交虚拟机购买快照订单 */ +export const submitSnapshotOrder = data => { + return http2.post("/v1/user/procedure/update_container_snapshot", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; +// 获取购买虚拟机数据卷价格 +export const getVolumePrice = data => { + return http2.post("/v1/user/procedure/get_price_volume", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; + +// 提交虚拟机数据卷订单 +export const submitVolumeOrder = data => { + return http2.post("/v1/user/procedure/update_container_volume", data, { + headers: { + "Content-Type": "multipart/form-data" + } + }); +}; diff --git a/src/utils/hide.js b/src/utils/hide.js new file mode 100644 index 0000000..f208e01 --- /dev/null +++ b/src/utils/hide.js @@ -0,0 +1,51 @@ +/** + * 复制文本到剪贴板 + * @param {string} text 要复制的文本 + * @returns {Promise} 是否复制成功 + */ +export const copyDomText = (text) => { + // 优先使用 navigator.clipboard API (现代浏览器) + if (navigator.clipboard && window.isSecureContext) { + return navigator.clipboard.writeText(text) + .then(() => { + return true; + }) + .catch((error) => { + console.error('复制到剪贴板失败:', error); + return fallbackCopyTextToClipboard(text); + }); + } else { + // 回退方案 + return fallbackCopyTextToClipboard(text); + } +}; + +/** + * 使用传统方法复制文本到剪贴板 + * @param {string} text 要复制的文本 + * @returns {boolean} 是否复制成功 + */ +const fallbackCopyTextToClipboard = (text) => { + try { + const textArea = document.createElement('textarea'); + textArea.value = text; + + // 避免滚动到底部 + textArea.style.top = '0'; + textArea.style.left = '0'; + textArea.style.position = 'fixed'; + textArea.style.opacity = '0'; + + document.body.appendChild(textArea); + textArea.focus(); + textArea.select(); + + const successful = document.execCommand('copy'); + document.body.removeChild(textArea); + + return successful; + } catch (err) { + console.error('复制到剪贴板失败:', err); + return false; + } +}; \ No newline at end of file diff --git a/src/utils/request.js b/src/utils/request.js index dbb97ce..a9a91d3 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,4 +1,26 @@ import axios from 'axios' +import { ElMessage } from 'element-plus' +import router from '@/router' + +// 基础URL +const baseUrl = 'https://apiservertest.s1f.ren' + +// 检查URL是否需要认证 +const urlNeedAuth = (url) => { + // 这里可以添加不需要认证的URL列表 + const noAuthUrls = ['/v1/user/login', '/v1/user/check/get_code_img', '/v1/user/register'] + return !noAuthUrls.some(noAuthUrl => url.includes(noAuthUrl)) +} + +// 检查token是否过期 +const isTokenExpired = () => { + const token = localStorage.getItem('token') + if (!token) return true + + // 这里可以添加token过期检查逻辑,如果有JWT可以解析它 + // 简单实现,仅检查token是否存在 + return false +} class Request { constructor(config = {}) { @@ -14,10 +36,10 @@ class Request { (config) => { // 在发送请求之前做些什么 // 例如:添加 token - // const token = localStorage.getItem('token') - // if (token) { - // config.headers.Authorization = `Bearer ${token}` - // } + const token = localStorage.getItem('token') + if (token) { + config.headers.Authorization = `Bearer ${token}` + } return config }, (error) => { @@ -49,7 +71,7 @@ class Request { // break // } // } - return Promise.reject(error) + return error.response.data } ) } @@ -82,11 +104,55 @@ class Request { // 创建默认实例 const request = new Request({ - baseURL: 'http://localhost:3000', + baseURL: baseUrl, timeout: 5000, headers: { - 'Content-Type': 'application/json' + 'Content-Type': 'multipart/form-data' } }) +export const mainUrl = baseUrl + "/acs" + +export const http2 = axios.create({ + baseURL: baseUrl, + timeout: 5000, + headers: {}, +}); + +http2.interceptors.request.use(config => { + const token = localStorage.getItem('token'); // 假设 token 存储在 localStorage + if(urlNeedAuth(config.url) && isTokenExpired()){ + if (token){ + localStorage.removeItem('token'); + ElMessage.warning('登陆过期,请重新登陆') + } + router.push('/login') + return Promise.reject(); + } + config.headers.Authorization = `Bearer ${token}`; + + config.url = '/acs' + config.url + return config +}) + +http2.interceptors.response.use( + response => response, // 正常响应时直接返回 + error => { + console.log('出现错误', error.response); + if (error.response == undefined) { + ElMessage.error("服务器错误,请稍后再试"); + return Promise.reject(error); + } + const { status } = error.response; + if (status === 401) { + localStorage.removeItem('token'); + ElMessage.warning('登陆过期,请重新登陆') + router.push('/login') + return Promise.reject(); + } + // 其他错误处理(可选) + return Promise.reject(error); + } +); + export default request \ No newline at end of file diff --git a/src/views/Login.vue b/src/views/Login.vue new file mode 100644 index 0000000..f202058 --- /dev/null +++ b/src/views/Login.vue @@ -0,0 +1,409 @@ + + + + + \ No newline at end of file diff --git a/src/views/NotFound.vue b/src/views/NotFound.vue index bc19912..f15d170 100644 --- a/src/views/NotFound.vue +++ b/src/views/NotFound.vue @@ -1,34 +1,61 @@ - \ No newline at end of file diff --git a/src/views/Redirect.vue b/src/views/Redirect.vue new file mode 100644 index 0000000..fb20ae8 --- /dev/null +++ b/src/views/Redirect.vue @@ -0,0 +1,21 @@ + + + \ No newline at end of file diff --git a/src/views/acs/images/ContainerImages.vue b/src/views/acs/images/ContainerImages.vue new file mode 100644 index 0000000..96bb108 --- /dev/null +++ b/src/views/acs/images/ContainerImages.vue @@ -0,0 +1,1281 @@ + + + + + \ No newline at end of file diff --git a/src/views/acs/images/ImageCategories.vue b/src/views/acs/images/ImageCategories.vue new file mode 100644 index 0000000..9838c1d --- /dev/null +++ b/src/views/acs/images/ImageCategories.vue @@ -0,0 +1,708 @@ + + + + + \ No newline at end of file diff --git a/src/views/acs/images/ImageRequests.vue b/src/views/acs/images/ImageRequests.vue new file mode 100644 index 0000000..d705efa --- /dev/null +++ b/src/views/acs/images/ImageRequests.vue @@ -0,0 +1,728 @@ + + + + + \ No newline at end of file diff --git a/src/views/acs/images/VmImages.vue b/src/views/acs/images/VmImages.vue new file mode 100644 index 0000000..63dd130 --- /dev/null +++ b/src/views/acs/images/VmImages.vue @@ -0,0 +1,904 @@ + + + + + + \ No newline at end of file diff --git a/src/views/acs/messages/Announcements.vue b/src/views/acs/messages/Announcements.vue new file mode 100644 index 0000000..a8d6051 --- /dev/null +++ b/src/views/acs/messages/Announcements.vue @@ -0,0 +1,423 @@ + + + + + \ No newline at end of file diff --git a/src/views/acs/messages/News.vue b/src/views/acs/messages/News.vue new file mode 100644 index 0000000..ead8aa4 --- /dev/null +++ b/src/views/acs/messages/News.vue @@ -0,0 +1,490 @@ + + + + + \ No newline at end of file diff --git a/src/views/acs/messages/Policies.vue b/src/views/acs/messages/Policies.vue new file mode 100644 index 0000000..f2e0f15 --- /dev/null +++ b/src/views/acs/messages/Policies.vue @@ -0,0 +1,498 @@ + + + + + \ No newline at end of file diff --git a/src/views/acs/nodes/Nodes.vue b/src/views/acs/nodes/Nodes.vue new file mode 100644 index 0000000..81cc90d --- /dev/null +++ b/src/views/acs/nodes/Nodes.vue @@ -0,0 +1,1036 @@ + + + + + \ No newline at end of file diff --git a/src/views/acs/nodes/components/VmList.vue b/src/views/acs/nodes/components/VmList.vue new file mode 100644 index 0000000..2de28a2 --- /dev/null +++ b/src/views/acs/nodes/components/VmList.vue @@ -0,0 +1,314 @@ + + + + + \ No newline at end of file diff --git a/src/views/acs/nodes/components/serverChart.vue b/src/views/acs/nodes/components/serverChart.vue new file mode 100644 index 0000000..d398f0b --- /dev/null +++ b/src/views/acs/nodes/components/serverChart.vue @@ -0,0 +1,340 @@ + + + + + \ No newline at end of file diff --git a/src/views/acs/nodes/server.vue b/src/views/acs/nodes/server.vue new file mode 100644 index 0000000..fa9f259 --- /dev/null +++ b/src/views/acs/nodes/server.vue @@ -0,0 +1,1373 @@ + + + + + \ No newline at end of file diff --git a/src/views/dashboard/Dashboard.vue b/src/views/dashboard/Dashboard.vue new file mode 100644 index 0000000..963bf5d --- /dev/null +++ b/src/views/dashboard/Dashboard.vue @@ -0,0 +1,892 @@ + + + + + \ No newline at end of file diff --git a/src/views/profile/ChangePassword.vue b/src/views/profile/ChangePassword.vue new file mode 100644 index 0000000..1fc43ff --- /dev/null +++ b/src/views/profile/ChangePassword.vue @@ -0,0 +1,525 @@ + + + + + \ No newline at end of file diff --git a/src/views/profile/UserInfo.vue b/src/views/profile/UserInfo.vue new file mode 100644 index 0000000..a4e080e --- /dev/null +++ b/src/views/profile/UserInfo.vue @@ -0,0 +1,529 @@ + + + + + \ No newline at end of file diff --git a/src/views/system/DomainWhitelist.vue b/src/views/system/DomainWhitelist.vue new file mode 100644 index 0000000..e1a84ef --- /dev/null +++ b/src/views/system/DomainWhitelist.vue @@ -0,0 +1,309 @@ + + + + + \ No newline at end of file diff --git a/src/views/system/OperationLog.vue b/src/views/system/OperationLog.vue new file mode 100644 index 0000000..8de1ab0 --- /dev/null +++ b/src/views/system/OperationLog.vue @@ -0,0 +1,395 @@ + + + + + \ No newline at end of file diff --git a/src/views/system/Users.vue b/src/views/system/Users.vue new file mode 100644 index 0000000..3ea12b8 --- /dev/null +++ b/src/views/system/Users.vue @@ -0,0 +1,578 @@ + + + + + \ No newline at end of file diff --git a/src/views/ticket/TicketChat.vue b/src/views/ticket/TicketChat.vue new file mode 100644 index 0000000..8aca872 --- /dev/null +++ b/src/views/ticket/TicketChat.vue @@ -0,0 +1,1561 @@ + + + + + \ No newline at end of file diff --git a/vite.config.js b/vite.config.js index bbcf80c..6bdfa39 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,7 +1,12 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' - +import { resolve } from 'path' // https://vite.dev/config/ export default defineConfig({ plugins: [vue()], -}) + resolve: { + alias: { + '@': resolve(__dirname, 'src') + } + } +}) \ No newline at end of file