去除图片转base64
This commit is contained in:
parent
51bc736e07
commit
64c336db01
|
|
@ -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)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 打开签名
|
||||
|
|
|
|||
Loading…
Reference in New Issue