blocked sending SMS
This commit is contained in:
@@ -4,7 +4,8 @@
|
||||
class="w-[96px] h-[96px] overflow-hidden border border-solid border-blue-600 bg-gray-50 rounded-md p-2"
|
||||
>
|
||||
<AUpload
|
||||
accept=".jpg,.jpeg,.png,.webp"
|
||||
class="fix-capture"
|
||||
accept="image/*"
|
||||
v-model:file-list="fileList"
|
||||
name="file"
|
||||
list-type="picture-card"
|
||||
@@ -12,7 +13,6 @@
|
||||
:multiple="false"
|
||||
:max-count="1"
|
||||
:action="uploadURL"
|
||||
:capture="undefined"
|
||||
:headers="fileHeader"
|
||||
:before-upload="beforeUpload"
|
||||
@change="handleChange"
|
||||
@@ -38,8 +38,9 @@ import { LoadingOutlined } from '@ant-design/icons-vue'
|
||||
import { usePrefix } from '@core/composable/usePrefix'
|
||||
import { uploadURL } from '@root/config'
|
||||
import { getToken } from '@/utils'
|
||||
import { fixFileCapture } from '@/utils/fixFileCapture'
|
||||
import { normalizeUploadFileResponse } from '@/utils/file'
|
||||
import { ref } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
|
||||
const { prefixCls } = usePrefix('index-image-uploader')
|
||||
const previewVisible = ref(false)
|
||||
@@ -93,6 +94,8 @@ const beforeUpload = (file: UploadProps['fileList'][number]) => {
|
||||
}
|
||||
|
||||
function handleChange(info: UploadChangeParam) {
|
||||
fixFileCapture()
|
||||
|
||||
if (info.file.status === 'uploading') {
|
||||
loading.value = true
|
||||
return
|
||||
@@ -130,6 +133,10 @@ function handleChange(info: UploadChangeParam) {
|
||||
emits('delete', info.file.uid)
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fixFileCapture()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
<div class="border border-solid border-blue-600 bg-gray-50 w-full rounded-md p-2">
|
||||
<div class="flex">
|
||||
<AUpload
|
||||
accept=".jpg,.jpeg,.png,.webp"
|
||||
class="fix-capture"
|
||||
accept="image/*"
|
||||
v-model:file-list="fileList"
|
||||
name="file"
|
||||
list-type="picture-card"
|
||||
:show-upload-list="false"
|
||||
:action="uploadURL"
|
||||
:capture="undefined"
|
||||
:headers="fileHeader"
|
||||
:showUploadList="true"
|
||||
:before-upload="beforeUpload"
|
||||
@@ -29,8 +29,10 @@
|
||||
import type {UploadChangeParam, UploadProps} from 'ant-design-vue'
|
||||
import {uploadURL} from '@root/config'
|
||||
import {getToken} from '@/utils'
|
||||
import {fixFileCapture} from '@/utils/fixFileCapture'
|
||||
import {usePrefix} from '@core/composable/usePrefix'
|
||||
import {message} from 'ant-design-vue'
|
||||
import {onMounted} from 'vue'
|
||||
|
||||
const {prefixCls} = usePrefix('product-image-uploader')
|
||||
const loading = ref<boolean>(false)
|
||||
@@ -65,6 +67,8 @@ const beforeUpload = (file: UploadProps['fileList'][number]) => {
|
||||
}
|
||||
|
||||
function handleChange(info: UploadChangeParam) {
|
||||
fixFileCapture()
|
||||
|
||||
if (info.file.status === 'uploading') {
|
||||
loading.value = true
|
||||
return
|
||||
@@ -84,6 +88,10 @@ function handleChange(info: UploadChangeParam) {
|
||||
emits('delete', info.file.uid)
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fixFileCapture()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
|
||||
@@ -42,6 +42,7 @@ import { onMounted, ref, watch, computed } from 'vue'
|
||||
import { LoadingOutlined } from '@ant-design/icons-vue'
|
||||
import { message } from 'ant-design-vue'
|
||||
import { getToken } from '@/utils'
|
||||
import { fixFileCapture } from '@/utils/fixFileCapture'
|
||||
|
||||
const loading = ref<boolean>(false)
|
||||
const percent = ref<number>(0)
|
||||
@@ -71,7 +72,7 @@ function handelChange({ file, fileList }) {
|
||||
if (Object.hasOwn(file, 'percent')) {
|
||||
percent.value = Math.floor(file.percent)
|
||||
}
|
||||
fixUpload()
|
||||
fixFileCapture()
|
||||
|
||||
if (file.status === 'uploading') {
|
||||
loading.value = true
|
||||
@@ -93,14 +94,8 @@ function handelChange({ file, fileList }) {
|
||||
}
|
||||
}
|
||||
|
||||
function fixUpload() {
|
||||
document.querySelectorAll('.fix-capture input').forEach((item) => {
|
||||
item.removeAttribute('capture')
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fixUpload()
|
||||
fixFileCapture()
|
||||
})
|
||||
|
||||
function deleteAvatar(e) {
|
||||
|
||||
Reference in New Issue
Block a user