|
@@ -226,6 +226,8 @@ class PatentwarningService extends CrudService {
|
|
|
const files = fs.readdirSync(filePath);
|
|
|
let result = [];
|
|
|
for (const file of files) {
|
|
|
+ console.log(_.trimEnd(filePath));
|
|
|
+ console.log(file);
|
|
|
const curPath = `${_.trimEnd(filePath)}${sep}${file}`;
|
|
|
if (fs.statSync(curPath).isDirectory()) {
|
|
|
const res = await this.findFileNameLoop(curPath, file);
|
|
@@ -256,22 +258,6 @@ class PatentwarningService extends CrudService {
|
|
|
fs.rmdirSync(filePath);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * 转换图片为base64
|
|
|
- * @param {Object} object excel获取的图片object
|
|
|
- * @property extension 后缀,文件类型
|
|
|
- * @property buffer 图片内容,不含头部信息的,
|
|
|
- */
|
|
|
- turnImageToBase64(object = {}) {
|
|
|
- const { extension, buffer } = object;
|
|
|
- if (extension && buffer) {
|
|
|
- const suffix = object.extension;
|
|
|
- const ib = object.buffer.toString('base64');
|
|
|
- const base64 = `data:image/${suffix};base64,${ib}`;
|
|
|
- return base64;
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
module.exports = PatentwarningService;
|