From fb7e6d8fe86f3a363aca9e760e6607dc596965b9 Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Sun, 30 Mar 2025 13:43:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E4=BF=A1=E6=81=AF=EF=BC=8C=E4=BF=AE=E5=A4=8D=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=8A=9F=E8=83=BD=E7=A9=BA=E8=BE=93=E5=85=A5=E6=90=9C?= =?UTF-8?q?=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/user.ts | 12 ++++++++++ src/components/upload-file.vue | 4 ++-- src/views/pages/ucenter.vue | 37 ++++++++++++++++++++++++++--- src/views/system/manage-model.vue | 5 ++++ src/views/system/manage-session.vue | 13 +++++++++- src/views/system/user.vue | 4 ++++ 6 files changed, 69 insertions(+), 6 deletions(-) diff --git a/src/api/user.ts b/src/api/user.ts index 058a8b8..60300f1 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -135,6 +135,18 @@ export const SearchUserService = (Data) => { }) } +export const GetUserStatisticService = (Data) => { + const params = new URLSearchParams(); + for (let key in Data) { + params.append(key, Data[key]) + } + return request.post('/user/statistic', params,{ + headers: { + 'token': Data.token, + } + }) +} + export const getQRService = (qrData) => { const params = new URLSearchParams(); diff --git a/src/components/upload-file.vue b/src/components/upload-file.vue index 8e5563e..1d9bee1 100644 --- a/src/components/upload-file.vue +++ b/src/components/upload-file.vue @@ -28,7 +28,7 @@ import { ElMessage } from 'element-plus'; const handle = (rawFile: any) => { console.log(rawFile); }; -const allowedTypes = ['doc', 'docx', 'pdf', 'txt', 'png', 'jpg', 'jpeg']; +const allowedTypes = ['doc', 'docx', 'pdf', 'txt', 'png', 'jpg', 'jpeg','md']; interface UploadData { upload_type: string; @@ -65,7 +65,7 @@ const headers = { const fileExtension = file.name.split('.').pop().toLowerCase(); const isAllowedType = allowedTypes.includes(fileExtension); if (!isAllowedType) { - ElMessage.error('不允许的文件类型,仅支持 doc, docx, pdf, txt, png, jpg, jpeg 格式'); + ElMessage.error('不允许的文件类型,仅支持 doc, docx, pdf, txt, png, jpg, jpeg, md 格式'); return false; } // 可以在这里进行文件验证等操作 diff --git a/src/views/pages/ucenter.vue b/src/views/pages/ucenter.vue index 5e4bc5b..db6324d 100644 --- a/src/views/pages/ucenter.vue +++ b/src/views/pages/ucenter.vue @@ -11,13 +11,16 @@
@@ -81,6 +84,7 @@ import 'vue-cropper/dist/index.css'; import avatar from '@/assets/img/img.jpg'; import TabsComp from '../element/tabs.vue'; import {GetUserInfoService} from "@/api/user"; +import { GetUserStatisticService } from "@/api/user"; import { UploadFileService } from "@/api/tool"; import { UserInfo } from '@/types/user'; import { FormOption, FormOptionList } from '@/types/form-option'; @@ -96,6 +100,12 @@ const form = reactive({ new: '', old: '', }); +const userStatistic = reactive({ + question: 0, + session: 0, + total: 0, + file_count: 0, +}); const userInfo = ref