Commit b1226def by 朱哲铨

bug 修复

parent 84cfda63
...@@ -20,13 +20,14 @@ function zip(from, to) { ...@@ -20,13 +20,14 @@ function zip(from, to) {
console.log("success"); console.log("success");
let data = fs.readdirSync(dirName); let data = fs.readdirSync(dirName);
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
let fileName = uuid.v4() + ".png";
let el = data[i]; let el = data[i];
let file_path = path.join(dirName, el); let file_path = path.join(dirName, el);
console.log(file_path, to); console.log(file_path, to);
fs.renameSync(file_path, path.join(to, el)); fs.renameSync(file_path, path.join(to, fileName));
arr.push({ arr.push({
fileName: el, fileName: fileName,
productionFile: path.join(to, el) productionFile: path.join(to, fileName)
}); });
} }
...@@ -69,8 +70,8 @@ export const downloadImage = list => { ...@@ -69,8 +70,8 @@ export const downloadImage = list => {
.length > 0; .length > 0;
if (flag) { if (flag) {
fileName = list[i].productionFile.split("/")[ fileName = list[i].productionFile.split("/")[
list[i].productionFile.split("/").length - 1 list[i].productionFile.split("/").length - 1
]; ];
type = 1; type = 1;
} else { } else {
fileName = uuid.v4() + ".png"; fileName = uuid.v4() + ".png";
...@@ -141,16 +142,16 @@ export const toSend = body => { ...@@ -141,16 +142,16 @@ export const toSend = body => {
path.join( path.join(
process.cwd(), process.cwd(),
"print/Profile/" + "print/Profile/" +
body.fileName.replace(".png", "") + body.fileName.replace(".png", "") +
".xml" ".xml"
) )
); );
fs.unlinkSync( fs.unlinkSync(
path.join( path.join(
process.cwd(), process.cwd(),
"print/Output/" + "print/Output/" +
body.fileName.replace(".png", "") + body.fileName.replace(".png", "") +
".arxp" ".arxp"
) )
); );
resolve("操作成功"); resolve("操作成功");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment