From ff14cf90f0839350eb45d6341d3474aa34293302 Mon Sep 17 00:00:00 2001 From: khalidlife Date: Tue, 30 Apr 2024 09:30:43 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix(useUpload.ts):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0Content-T?= =?UTF-8?q?ype=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UploadFile/src/useUpload.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/UploadFile/src/useUpload.ts b/src/components/UploadFile/src/useUpload.ts index cadad9e9..c0465a28 100644 --- a/src/components/UploadFile/src/useUpload.ts +++ b/src/components/UploadFile/src/useUpload.ts @@ -17,7 +17,11 @@ export const useUpload = () => { // 1.2 获取文件预签名地址 const presignedInfo = await FileApi.getFilePresignedUrl(fileName) // 1.3 上传文件(不能使用 ElUpload 的 ajaxUpload 方法的原因:其使用的是 FormData 上传,Minio 不支持) - return axios.put(presignedInfo.uploadUrl, options.file).then(() => { + return axios.put(presignedInfo.uploadUrl, options.file, { + headers: { + 'Content-Type': options.file.type, + } + }).then(() => { // 1.4. 记录文件信息到后端(异步) createFile(presignedInfo, fileName, options.file) // 通知成功,数据格式保持与后端上传的返回结果一致 From de967a01607f4bbd7a900b5f45a01d2421320abc Mon Sep 17 00:00:00 2001 From: AhJindeg Date: Tue, 30 Apr 2024 08:50:55 +0000 Subject: [PATCH 2/4] update src/views/infra/webSocket/index.vue. #434 Signed-off-by: AhJindeg --- src/views/infra/webSocket/index.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/infra/webSocket/index.vue b/src/views/infra/webSocket/index.vue index dec256fe..0f0e351f 100644 --- a/src/views/infra/webSocket/index.vue +++ b/src/views/infra/webSocket/index.vue @@ -54,7 +54,7 @@
    -
  • +
  • 收到消息: {{ formatDate(msg.time) }} @@ -92,6 +92,7 @@ const { status, data, send, close, open } = useWebSocket(server.value, { /** 监听接收到的数据 */ const messageList = ref([] as { time: number; text: string }[]) // 消息列表 +const messageReverseList = computed(() => messageList.value.slice().reverse()) watchEffect(() => { if (!data.value) { return From 20a97806546720253906f27b0adaa388d8f33115 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 1 May 2024 20:53:01 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91?= =?UTF-8?q?=E5=95=86=E5=9F=8E=EF=BC=9A=E7=A7=92=E6=9D=80=E6=97=B6=E6=AE=B5?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E7=BC=96=E8=BE=91=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/promotion/seckill/seckillConfig.ts | 73 +++--- .../seckill/config/SeckillConfigForm.vue | 105 ++++++-- .../mall/promotion/seckill/config/index.vue | 243 ++++++++++++------ .../seckill/config/seckillConfig.data.ts | 82 ------ 4 files changed, 276 insertions(+), 227 deletions(-) delete mode 100644 src/views/mall/promotion/seckill/config/seckillConfig.data.ts diff --git a/src/api/mall/promotion/seckill/seckillConfig.ts b/src/api/mall/promotion/seckill/seckillConfig.ts index 23ad15ca..e3d618f7 100644 --- a/src/api/mall/promotion/seckill/seckillConfig.ts +++ b/src/api/mall/promotion/seckill/seckillConfig.ts @@ -1,49 +1,48 @@ import request from '@/config/axios' +// 秒杀时段 VO export interface SeckillConfigVO { - id: number - name: string - startTime: string - endTime: string - sliderPicUrls: string[] - status: number + id: number // 编号 + name: string // 秒杀时段名称 + startTime: string // 开始时间点 + endTime: string // 结束时间点 + sliderPicUrls: string[] // 秒杀轮播图 + status: number // 活动状态 } -// 查询秒杀时段配置列表 -export const getSeckillConfigPage = async (params) => { - return await request.get({ url: '/promotion/seckill-config/page', params }) -} +// 秒杀时段 API +export const SeckillConfigApi = { + // 查询秒杀时段分页 + getSeckillConfigPage: async (params: any) => { + return await request.get({ url: `/promotion/seckill-config/page`, params }) + }, -// 查询秒杀时段配置详情 -export const getSeckillConfig = async (id: number) => { - return await request.get({ url: '/promotion/seckill-config/get?id=' + id }) -} + // 查询秒杀时段详情 + getSeckillConfig: async (id: number) => { + return await request.get({ url: `/promotion/seckill-config/get?id=` + id }) + }, -// 获得所有开启状态的秒杀时段精简列表 -export const getSimpleSeckillConfigList = async () => { - return await request.get({ url: '/promotion/seckill-config/list-all-simple' }) -} + // 新增秒杀时段 + createSeckillConfig: async (data: SeckillConfigVO) => { + return await request.post({ url: `/promotion/seckill-config/create`, data }) + }, -// 新增秒杀时段配置 -export const createSeckillConfig = async (data: SeckillConfigVO) => { - return await request.post({ url: '/promotion/seckill-config/create', data }) -} + // 修改秒杀时段 + updateSeckillConfig: async (data: SeckillConfigVO) => { + return await request.put({ url: `/promotion/seckill-config/update`, data }) + }, -// 修改秒杀时段配置 -export const updateSeckillConfig = async (data: SeckillConfigVO) => { - return await request.put({ url: '/promotion/seckill-config/update', data }) -} + // 删除秒杀时段 + deleteSeckillConfig: async (id: number) => { + return await request.delete({ url: `/promotion/seckill-config/delete?id=` + id }) + }, -// 修改时段配置状态 -export const updateSeckillConfigStatus = (id: number, status: number) => { - const data = { - id, - status + // 修改时段配置状态 + updateSeckillConfigStatus: async (id: number, status: number) => { + const data = { + id, + status + } + return request.put({ url: '/promotion/seckill-config/update-status', data: data }) } - return request.put({ url: '/promotion/seckill-config/update-status', data: data }) -} - -// 删除秒杀时段配置 -export const deleteSeckillConfig = async (id: number) => { - return await request.delete({ url: '/promotion/seckill-config/delete?id=' + id }) } diff --git a/src/views/mall/promotion/seckill/config/SeckillConfigForm.vue b/src/views/mall/promotion/seckill/config/SeckillConfigForm.vue index d7f07e92..a7ce5fe7 100644 --- a/src/views/mall/promotion/seckill/config/SeckillConfigForm.vue +++ b/src/views/mall/promotion/seckill/config/SeckillConfigForm.vue @@ -1,15 +1,57 @@ - diff --git a/src/views/mall/promotion/seckill/config/index.vue b/src/views/mall/promotion/seckill/config/index.vue index 033b7e90..9fa2c1e3 100644 --- a/src/views/mall/promotion/seckill/config/index.vue +++ b/src/views/mall/promotion/seckill/config/index.vue @@ -1,94 +1,172 @@ -