build(deps): 📦 upgrade dependencies to latest versions
This commit is contained in:
24
package.json
vendored
24
package.json
vendored
@@ -75,7 +75,7 @@
|
||||
"gitcz": "git-cz"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/github": "^6.0.1",
|
||||
"@actions/github": "^7.0.0",
|
||||
"@breezystack/lamejs": "^1.2.7",
|
||||
"@fingerprintjs/fingerprintjs": "^5.0.1",
|
||||
"@tauri-apps/api": "2.9.1",
|
||||
@@ -105,11 +105,11 @@
|
||||
"dayjs": "^1.11.19",
|
||||
"digest-wasm": "^0.1.4",
|
||||
"dompurify": "^3.3.0",
|
||||
"driver.js": "^1.3.6",
|
||||
"driver.js": "^1.4.0",
|
||||
"es-toolkit": "^1.43.0",
|
||||
"file-type": "^21.1.1",
|
||||
"grapheme-splitter": "^1.0.4",
|
||||
"hula-emojis": "^1.2.31",
|
||||
"hula-emojis": "^1.3.1",
|
||||
"internal-ip": "^8.0.1",
|
||||
"markstream-vue": "0.0.3-beta.4",
|
||||
"mermaid": "^11.12.1",
|
||||
@@ -120,18 +120,18 @@
|
||||
"pinia-plugin-persistedstate": "^4.7.1",
|
||||
"pinia-shared-state": "^1.0.1",
|
||||
"seemly": "^0.3.10",
|
||||
"stream-markdown": "^0.0.11",
|
||||
"stream-monaco": "^0.0.8",
|
||||
"stream-markdown": "^0.0.13",
|
||||
"stream-monaco": "^0.0.15",
|
||||
"tauri-plugin-mic-recorder-api": "^2.0.0",
|
||||
"tauri-plugin-safe-area-insets": "^0.1.0",
|
||||
"three": "^0.182.0",
|
||||
"tlbs-map-vue": "^1.3.1",
|
||||
"tlbs-map-vue": "^1.3.2",
|
||||
"vant": "^4.9.21",
|
||||
"vue": "^3.5.25",
|
||||
"vue": "^3.5.26",
|
||||
"vue-cropper": "1.1.4",
|
||||
"vue-demi": "0.14.10",
|
||||
"vue-i18n": "^11.1.12",
|
||||
"vue-router": "^4.6.3",
|
||||
"vue-router": "^4.6.4",
|
||||
"vue-virtual-scroller": "2.0.0-beta.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -160,22 +160,22 @@
|
||||
"chalk": "^5.6.2",
|
||||
"commitizen": "^4.3.1",
|
||||
"cz-git": "^1.12.0",
|
||||
"eruda": "^3.4.3",
|
||||
"happy-dom": "^20.0.2",
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^16.2.7",
|
||||
"postcss-pxtorem": "^6.1.0",
|
||||
"prettier": "^3.7.4",
|
||||
"release-it": "^19.0.6",
|
||||
"sass": "1.96.0",
|
||||
"sass": "1.97.2",
|
||||
"typescript": "^5.9.3",
|
||||
"unplugin-auto-import": "^20.3.0",
|
||||
"unplugin-vue-components": "^30.0.0",
|
||||
"vite": "7.2.7",
|
||||
"vite": "7.3.1",
|
||||
"vite-plugin-vue-setup-extend": "^0.4.0",
|
||||
"vitest": "^4.0.15",
|
||||
"vue-tsc": "^3.1.5",
|
||||
"web-vitals": "^5.1.0",
|
||||
"eruda": "^3.4.3"
|
||||
"web-vitals": "^5.1.0"
|
||||
},
|
||||
"config": {
|
||||
"commitizen": {
|
||||
|
||||
976
pnpm-lock.yaml
generated
vendored
976
pnpm-lock.yaml
generated
vendored
File diff suppressed because it is too large
Load Diff
@@ -287,10 +287,6 @@
|
||||
<p class="text-(10px --text-color center) w-30px truncate">
|
||||
{{ item.name }}
|
||||
</p>
|
||||
<n-flex align="center" justify="center" :size="4" class="w-30px">
|
||||
<Icon v-if="item.linkedGithub" icon="mdi:github" class="text-12px" />
|
||||
<Icon v-if="item.linkedGitee" icon="simple-icons:gitee" class="text-12px" />
|
||||
</n-flex>
|
||||
</n-flex>
|
||||
</template>
|
||||
</n-flex>
|
||||
@@ -620,7 +616,6 @@ import { notification, setSessionTop, shield, updateRoomInfo } from '@/utils/ImR
|
||||
import { canvasToImageBytes } from '@/utils/Canvas2Dom'
|
||||
import { invokeWithErrorHandler } from '@/utils/TauriInvokeHandler'
|
||||
import { isMac, isWindows } from '@/utils/PlatformConstants'
|
||||
import { Icon } from '@iconify/vue'
|
||||
|
||||
// 转发群二维码尺寸
|
||||
const QR_IMAGE_SIZE = 200
|
||||
|
||||
@@ -2,6 +2,7 @@ import { MsgEnum } from '@/enums'
|
||||
import { UploadProviderEnum } from '@/hooks/useUpload'
|
||||
import { useChatStore } from '@/stores/chat'
|
||||
import { messageStrategyMap } from '@/strategy/MessageStrategy'
|
||||
import { removeTempFile } from '@/utils/TempFileManager'
|
||||
|
||||
type ReplyContext = {
|
||||
value: {
|
||||
@@ -105,6 +106,7 @@ export const useCustomForwardTask = () => {
|
||||
return messageBody
|
||||
} finally {
|
||||
releaseBlobUrl(msg?.url)
|
||||
await removeTempFile(msg?.path, { reason: '删除临时二维码文件失败' })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Channel, invoke } from '@tauri-apps/api/core'
|
||||
import { BaseDirectory, remove, stat, writeFile } from '@tauri-apps/plugin-fs'
|
||||
import { BaseDirectory, stat, writeFile } from '@tauri-apps/plugin-fs'
|
||||
import { fetch } from '@tauri-apps/plugin-http'
|
||||
import { createEventHook } from '@vueuse/core'
|
||||
import { TauriCommand, UploadSceneEnum } from '@/enums'
|
||||
@@ -10,6 +10,7 @@ import { getImageDimensions } from '@/utils/ImageUtils'
|
||||
import { getQiniuToken, getUploadProvider } from '@/utils/ImRequestUtils'
|
||||
import { isAndroid, isMobile } from '@/utils/PlatformConstants'
|
||||
import { getWasmMd5 } from '@/utils/Md5Util'
|
||||
import { removeTempFile } from '@/utils/TempFileManager'
|
||||
|
||||
/** 文件信息类型 */
|
||||
export type FileInfoType = {
|
||||
@@ -122,7 +123,7 @@ export const useUpload = () => {
|
||||
onProgress
|
||||
})
|
||||
} finally {
|
||||
await remove(tempPath, { baseDir }).catch(() => void 0)
|
||||
await removeTempFile(tempPath, { baseDir, silent: true })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { BaseDirectory, create, exists, mkdir, readFile, remove } from '@tauri-apps/plugin-fs'
|
||||
import { BaseDirectory, create, exists, mkdir, readFile } from '@tauri-apps/plugin-fs'
|
||||
import { startRecording, stopRecording } from 'tauri-plugin-mic-recorder-api'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
import { calculateCompressionRatio, compressAudioToMp3, getAudioInfo } from '@/utils/AudioCompression'
|
||||
@@ -6,6 +6,7 @@ import { getImageCache } from '@/utils/PathUtil.ts'
|
||||
import { isMobile } from '@/utils/PlatformConstants'
|
||||
import { UploadSceneEnum } from '../enums'
|
||||
import { useUpload } from './useUpload'
|
||||
import { removeTempFile } from '@/utils/TempFileManager'
|
||||
|
||||
// 导入worker计时器
|
||||
let timerWorker: Worker | null = null
|
||||
@@ -156,12 +157,7 @@ export const useVoiceRecordRust = (options: VoiceRecordRustOptions = {}) => {
|
||||
})
|
||||
|
||||
// 删除原始的wav文件,释放磁盘空间
|
||||
try {
|
||||
await remove(audioPath)
|
||||
console.log('已删除原始录音文件:', audioPath)
|
||||
} catch (deleteError) {
|
||||
console.warn('删除原始录音文件失败:', deleteError)
|
||||
}
|
||||
await removeTempFile(audioPath, { reason: '删除原始录音文件失败' })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('停止录音或压缩失败:', error)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { BaseDirectory, readFile, remove, writeFile } from '@tauri-apps/plugin-fs'
|
||||
import { BaseDirectory, readFile, writeFile } from '@tauri-apps/plugin-fs'
|
||||
import DOMPurify from 'dompurify'
|
||||
import type { Ref } from 'vue'
|
||||
import { AppException } from '@/common/exception.ts'
|
||||
@@ -12,6 +12,7 @@ import { getImageDimensions } from '@/utils/ImageUtils'
|
||||
import { isMobile } from '@/utils/PlatformConstants'
|
||||
import { generateVideoThumbnail } from '@/utils/VideoThumbnail'
|
||||
import { useGroupStore } from '../stores/group'
|
||||
import { removeTempFile } from '@/utils/TempFileManager'
|
||||
|
||||
interface MessageStrategy {
|
||||
getMsg: (msgInputValue: string, replyValue: any, fileList?: File[]) => any
|
||||
@@ -1020,11 +1021,7 @@ class VideoMessageStrategyImpl extends AbstractMessageStrategy {
|
||||
const result = await this.uploadHook.doUpload(tempPath, uploadUrl, { ...options, enableDeduplication: true })
|
||||
|
||||
// 清理临时文件
|
||||
try {
|
||||
await remove(tempPath, { baseDir })
|
||||
} catch (cleanupError) {
|
||||
console.warn('清理临时文件失败:', cleanupError)
|
||||
}
|
||||
await removeTempFile(tempPath, { baseDir })
|
||||
|
||||
// 如果是七牛云上传,返回qiniuUrl
|
||||
if (options?.provider === UploadProviderEnum.QINIU) {
|
||||
|
||||
45
src/utils/TempFileManager.ts
Normal file
45
src/utils/TempFileManager.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { BaseDirectory, remove } from '@tauri-apps/plugin-fs'
|
||||
import { isMobile } from '@/utils/PlatformConstants'
|
||||
|
||||
export type RemoveTempFileOptions = {
|
||||
/**
|
||||
* 指定基础目录;不传则根据平台自动选择 AppData / AppCache。
|
||||
* 传入 null 则按绝对路径删除。
|
||||
*/
|
||||
baseDir?: BaseDirectory | null
|
||||
/**
|
||||
* 日志前缀,方便定位调用来源。
|
||||
*/
|
||||
reason?: string
|
||||
/**
|
||||
* 是否静默失败,默认 false(打印 warn)。
|
||||
*/
|
||||
silent?: boolean
|
||||
}
|
||||
|
||||
const getDefaultBaseDir = () => (isMobile() ? BaseDirectory.AppData : BaseDirectory.AppCache)
|
||||
|
||||
const normalizeFsPath = (path: string) => path.replace(/\\/g, '/')
|
||||
|
||||
const shouldSkipRemoval = (path?: string | null) => {
|
||||
if (!path) return true
|
||||
// 远程资源或 blob URL 无需删除
|
||||
return /^https?:\/\//i.test(path) || path.startsWith('blob:')
|
||||
}
|
||||
|
||||
export const removeTempFile = async (path?: string | null, options: RemoveTempFileOptions = {}) => {
|
||||
if (shouldSkipRemoval(path)) return
|
||||
|
||||
const normalizedPath = normalizeFsPath(path!)
|
||||
const baseDir = options.baseDir === undefined ? getDefaultBaseDir() : options.baseDir
|
||||
const removeOptions = baseDir ? { baseDir } : undefined
|
||||
|
||||
try {
|
||||
await remove(normalizedPath, removeOptions)
|
||||
} catch (error) {
|
||||
if (!options.silent) {
|
||||
const prefix = options.reason ?? '删除临时文件失败'
|
||||
console.warn(`${prefix}:`, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
import { invoke } from '@tauri-apps/api/core'
|
||||
import { appCacheDir, join } from '@tauri-apps/api/path'
|
||||
import { BaseDirectory, remove, writeFile } from '@tauri-apps/plugin-fs'
|
||||
import { BaseDirectory, writeFile } from '@tauri-apps/plugin-fs'
|
||||
import { AppException } from '@/common/exception'
|
||||
import { isMobile } from '@/utils/PlatformConstants'
|
||||
import { removeTempFile } from '@/utils/TempFileManager'
|
||||
|
||||
// 压缩缩略图至给定尺寸与质量,保持比例,返回压缩后的 File
|
||||
const compressThumbnail = async (
|
||||
@@ -131,11 +132,7 @@ export const generateVideoThumbnail = async (file: File): Promise<File> => {
|
||||
const thumbnailBlob = new Blob([bytes], { type: 'image/jpeg' })
|
||||
const thumbnailFile = new File([thumbnailBlob], 'thumbnail.jpg', { type: 'image/jpeg' })
|
||||
|
||||
try {
|
||||
await remove(tempPath, { baseDir })
|
||||
} catch (cleanupError) {
|
||||
console.warn('清理临时文件失败:', cleanupError)
|
||||
}
|
||||
await removeTempFile(tempPath, { baseDir })
|
||||
|
||||
return await compressThumbnail(thumbnailFile)
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user