123456789101112131415 |
- import { processFile, ProcessFileOptions } from '@/uni_modules/lime-file-utils'
- export function pathToBase64(path : string) : Promise<string> {
- return new Promise((resolve, reject) => {
- processFile({
- type: 'toDataURL',
- path,
- success(res : string) {
- resolve(res)
- },
- fail(err: any){
- reject(err)
- }
- } as ProcessFileOptions)
- })
- }
|