| 1234567891011121314151617181920212223242526272829 |
- const async = require('async');
- const fs = require('fs')
- const path = require('path')
- const ImageUtils = require('../src/service/ImageUtils')
- async function readDir(dir, orderId, subOrderId, relative) {
- await async.forEachOf(fs.readdirSync(dir), async child => {
- if (!child.startsWith('.')) {
- let currRelative = relative ? child : (relative + '/' + child)
- console.log(currRelative);
- let info = fs.statSync(path.resolve(dir, child));
- if (info.isDirectory()) {
- await readDir(path.resolve(dir, child), orderId, subOrderId, currRelative)
- } else {
- }
- }
- })
- }
- readDir('/Users/drew/Downloads/桌面客户端上传测试', 111, 222, '')
- async function t() {
- for (let i = 0; i < 10; i++) {
- let src = await ImageUtils.makeThumbnail('/Users/drew/Downloads/桌面客户端上传测试/456789096543/1G4A2391.CR2');
- console.log(src);
- }
- }
- t()
|