|
@@ -140,15 +140,16 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import os from 'os'
|
|
|
-import fs from 'fs'
|
|
|
+import os from 'os';
|
|
|
+import fs from 'fs';
|
|
|
import path from 'path';
|
|
|
-import electronApi from '@/utils/electronApi';
|
|
|
+import electronApi from '@/utils/electronApi';
|
|
|
import softUpdate from './update.vue';
|
|
|
import softHeader from './header.vue';
|
|
|
-import pjson from '/package.json'
|
|
|
-import fse from 'fs-extra'
|
|
|
+import pjson from '/package.json';
|
|
|
+import fse from 'fs-extra';
|
|
|
const fg = require('fast-glob');
|
|
|
+import { v4 as uuidv4 } from 'uuid';
|
|
|
|
|
|
let separator = '';
|
|
|
if (os.platform == 'linux') {
|
|
@@ -417,7 +418,6 @@ export default {
|
|
|
if(this.handleData.type == '1'){ // 复制
|
|
|
//fse.copySync(item.path, newFilePath);
|
|
|
//item.status = '2';
|
|
|
-
|
|
|
fse.copy(item.path, newFilePath, {overwrite: false, errorOnExist: true}).then(() => {
|
|
|
console.log('复制成功!')
|
|
|
item.status = '2';
|
|
@@ -426,7 +426,7 @@ export default {
|
|
|
console.error('复制失败', err.toString(), item.path)
|
|
|
if(str.indexOf('already exists') > -1 && str.indexOf(item.name) > -1){
|
|
|
console.log('重新复制')
|
|
|
- // newFilePath = newPath + separator + item.title + '重复' + new Date().getTime() + i + item.suffix;
|
|
|
+ // newFilePath = newPath + separator + item.title + '重复' + uuidv4() + i.toString() + item.suffix;
|
|
|
}
|
|
|
item.status = '6';
|
|
|
})
|