fix:图片格式jpeg→jpg,相机photoSuffix=jpg+minio扩展映射
This commit is contained in:
parent
4d4446820c
commit
48809b1f42
@ -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>
|
||||||
|
|||||||
@ -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)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user