hookehuyr

feat(上传): 修改文件上传路径以包含用户手机号

将图片和文件的上传路径从通用路径改为包含用户手机号的路径,格式为 `mlaj/upload/checkin/{mobile}/{type}/{md5}{suffix}`。这样可以更好地隔离不同用户的文件,便于管理和追踪。
<!--
* @Date: 2025-06-03 09:41:41
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-06-03 14:28:51
* @LastEditTime: 2025-06-03 17:11:53
* @FilePath: /mlaj/src/views/checkin/upload/file.vue
* @Description: 音视频文件上传组件
-->
......@@ -73,9 +73,11 @@ import { qiniuTokenAPI, qiniuUploadAPI, saveFileAPI } from '@/api/common'
import BMF from 'browser-md5-file'
import _ from 'lodash'
import { useTitle } from '@vueuse/core';
import { useAuth } from '@/contexts/auth'
const route = useRoute()
const router = useRouter()
const { currentUser } = useAuth()
useTitle(route.meta.title);
const max_count = ref(5);
......@@ -192,7 +194,7 @@ const handleUpload = async (file) => {
// 新文件上传
if (tokenResult.token) {
const suffix = /.[^.]+$/.exec(file.file.name) || ''
const fileName = `uploadForm/${route.query.code || 'checkin'}/${md5}${suffix}`
const fileName = `mlaj/upload/checkin/${currentUser.value.mobile}/file/${md5}${suffix}`
const { filekey } = await uploadToQiniu(
file.file,
......
......@@ -59,9 +59,11 @@ import { qiniuTokenAPI, qiniuUploadAPI, saveFileAPI } from '@/api/common'
import BMF from 'browser-md5-file'
import _ from 'lodash'
import { useTitle } from '@vueuse/core';
import { useAuth } from '@/contexts/auth'
const route = useRoute()
const router = useRouter()
const { currentUser } = useAuth()
useTitle(route.meta.title);
const max_count = ref(5);
......@@ -180,7 +182,7 @@ const handleUpload = async (file) => {
// 新文件上传
if (tokenResult.token) {
const suffix = /.[^.]+$/.exec(file.file.name) || ''
const fileName = `uploadForm/${route.query.code || 'checkin'}/${md5}${suffix}`
const fileName = `mlaj/upload/checkin/${currentUser.value.mobile}/img/${md5}${suffix}`
const { filekey, image_info } = await uploadToQiniu(
file.file,
......