0bd354cfee
ci/woodpecker/tag/build Pipeline was successful
① 修复 message 解构错误(导致「undefined is not an object (evaluating 't.warning')」):
useMessage() 返回的是 { toasts, success, error, info, warning, removeToast } 对象本身,
而 HomeView 与 LeaveView 写成了 const { message } = useMessage(),解构出的 message 恒为 undefined,
所有 message.xxx() 调用都会抛错。改为 const message = useMessage()(其余 18 个文件均为正确写法)。
② 二维码改为前端 jsQR 解析(问题 3、4):
上传二维码时不再走后端解析,直接在前端用 jsQR 从画布像素解码(多尺度尝试 + attemptBoth),
提取 uuid 存表;前端识别失败时降级调用后端 /task/qr/decode(gozxing 多尺度重试)兜底。
好处:免上传、免压缩、响应快;且能正确解析 https://...?uuid=xxx&isNeedExtra=0&schoolId=... 这类链接。
新增依赖 jsqr@^1.4.0。
③ 图片上传前前端压缩到 ≤300KB(问题 4):
签到照片等需上传 OBS 的图片,先经 canvas 逐步降质量/降尺寸压缩到 300KB 以下再上传,
避免大图(如 4032x3024)直传。二维码字段不走压缩(不保存图片,只存 uuid)。
④ 二维码上传增加 loading(问题 1):
原二维码分支从未设置 uploadingImage,故无 loading 效果。现统一走 uploadingImage + uploadingLabel
(解析中/压缩中/上传中),二维码与图片两种字段的 loading 块都补上阶段文案。
⑤ 验证:vue-tsc --noEmit、npm run build 通过。不检查部署。
35 lines
817 B
JSON
35 lines
817 B
JSON
{
|
|
"name": "tianshen-web-new",
|
|
"private": true,
|
|
"version": "1.0.0",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "vite build && node scripts/postbuild-css.mjs",
|
|
"preview": "vite preview"
|
|
},
|
|
"dependencies": {
|
|
"axios": "^1.13.6",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"jsqr": "^1.4.0",
|
|
"lucide-vue-next": "^1.0.0",
|
|
"qrcode": "^1.5.4",
|
|
"reka-ui": "^2.10.4",
|
|
"tailwind-merge": "^3.5.0",
|
|
"vue": "^3.5.30",
|
|
"vue-router": "^5.0.4"
|
|
},
|
|
"devDependencies": {
|
|
"@tailwindcss/vite": "^4.2.2",
|
|
"@types/node": "^26.0.1",
|
|
"@types/qrcode": "^1.5.6",
|
|
"@vitejs/plugin-vue": "^6.0.5",
|
|
"lightningcss": "^1.33.0",
|
|
"tailwindcss": "^4.2.2",
|
|
"typescript": "~5.9.3",
|
|
"vite": "^8.0.1",
|
|
"vue-tsc": "^3.2.5"
|
|
}
|
|
}
|