fix:图片格式jpeg→jpg,相机photoSuffix=jpg+minio扩展映射

This commit is contained in:
ShenQiLun 2026-06-26 12:01:07 +08:00
parent 4d4446820c
commit 48809b1f42
2 changed files with 2 additions and 0 deletions

View File

@ -6,6 +6,7 @@
:style="'width:' + camSize + 'px;height:' + camSize + 'px;margin-top:' + frameTop + 'px;margin-left:' + frameLeft + 'px;'" :style="'width:' + camSize + 'px;height:' + camSize + 'px;margin-top:' + frameTop + 'px;margin-left:' + frameLeft + 'px;'"
flash="off" flash="off"
facing="back" facing="back"
photoSuffix="jpg"
@onPictureTaken="onPictureTaken" @onPictureTaken="onPictureTaken"
@onCameraOpened="onCameraOpened" @onCameraOpened="onCameraOpened"
></ima-camera-view> ></ima-camera-view>

View File

@ -190,6 +190,7 @@ export function uploadImage(filePath, typeDir) {
var datePath = now.getFullYear() + '-' + pad(now.getMonth() + 1) + '-' + pad(now.getDate()) var datePath = now.getFullYear() + '-' + pad(now.getMonth() + 1) + '-' + pad(now.getDate())
var ext = (filePath.match(/\.(\w+)$/) || [])[1] || 'jpg' var ext = (filePath.match(/\.(\w+)$/) || [])[1] || 'jpg'
ext = ext.toLowerCase() ext = ext.toLowerCase()
if (ext === 'jpeg') ext = 'jpg'
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = Math.random() * 16 | 0 var r = Math.random() * 16 | 0
return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16) return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16)