合同小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
495 B

  1. // @ts-nocheck
  2. import { processFile, type ProcessFileOptions } from '@/uni_modules/lime-file-utils'
  3. /**
  4. * base64转路径
  5. * @param {Object} base64
  6. */
  7. export function base64ToPath(base64: string, filename: string | null = null):Promise<string> {
  8. return new Promise((resolve,reject) => {
  9. processFile({
  10. type: 'toDataURL',
  11. path: base64,
  12. filename,
  13. success(res: string){
  14. resolve(res)
  15. },
  16. fail(err){
  17. reject(err)
  18. }
  19. } as ProcessFileOptions)
  20. })
  21. }