去除图片转base64

This commit is contained in:
binbin_pan 2025-01-09 09:36:49 +08:00
parent 51bc736e07
commit 64c336db01
1 changed files with 0 additions and 50 deletions

View File

@ -16,7 +16,6 @@
</template>
<script setup>
import { pathToBase64, base64ToPath } from 'image-tools'
import { ref, reactive, onMounted } from 'vue'
import { getSign, updateSign } from '@/services/signature.js'
import { baseURL } from '@/utils/http'
@ -52,55 +51,6 @@ const complete = (e) => {
signType.value = 0
console.log(e) // base
uploadImg(e)
toBase64(e)
.then((res) => {
// console.log('🚀 ~ .then ~ res:', res)
// signType.value = 0
// imgPath.value = res
// isRotate.value = true
// const params = {
// signUrl: res,
// signType: 0,
// }
// uploadImg(res)
// updateSign(params)
// .then((res) => {
// console.log('🚀 ~ .updateSign ~ res:', res)
// getSignData()
// })
// .catch((err) => {
// console.log('🚀 ~ .updateSign ~ err:', err)
// })
})
.catch((err) => {
console.log(err)
})
}
// base64
const toBase64 = (filePath) => {
return new Promise((resolve, reject) => {
pathToBase64(filePath)
.then((res) => {
resolve(res)
})
.catch((err) => {
reject(err)
})
})
}
// base64
const toPath = (base64) => {
return new Promise((resolve, reject) => {
base64ToPath(base64)
.then((res) => {
resolve(res)
})
.catch((err) => {
reject(err)
})
})
}
//