diff --git a/package.json b/package.json index 7e2e499..75da1f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aix-win", - "version": "2.1.9", + "version": "2.1.12", "description": "", "main": "./out/main/index.js", "author": "example.com", diff --git a/src/main/file.js b/src/main/file.js index 7612bf4..3de3333 100644 --- a/src/main/file.js +++ b/src/main/file.js @@ -246,8 +246,10 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) { /*创建新的ppt文件*/ ipcMain.on('creat-ai-file-default', (e, { name, url, uploadData, cookie }) => { createFolder('tempFile').then(async () => { + let lastname = decodeURIComponent(url); + name = lastname.substring(lastname.lastIndexOf("/")+1) let path = appTempFilePath + name.replace(/[\\/:*?"<>|]/, '') - let {type,item} = await downloadFile(url,name) + let {type,item} = await downloadFiles(url,name) if (type==="成功") { let fileType = 'application/vnd.openxmlformats-officedocument.presentationml.presentation' let formData = new FormData() @@ -279,7 +281,8 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) { }) }) - function downloadFile(url,fileName) { + function downloadFiles(url,fileName) { + console.log(url,fileName) return new Promise((resolve, reject)=>{ const browserWindow = BrowserWindow.getFocusedWindow() const id = manager.download({ diff --git a/src/renderer/src/views/teach/standardAnalysis/index.vue b/src/renderer/src/views/teach/standardAnalysis/index.vue index 1a63e8c..75b027b 100644 --- a/src/renderer/src/views/teach/standardAnalysis/index.vue +++ b/src/renderer/src/views/teach/standardAnalysis/index.vue @@ -247,14 +247,12 @@ const getAllSubject = async () => { rows && rows.map(item => { if(edustage === item.edustage && item.edusubject === edusubject){ bookInfo.value = {...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar,bookName: bookNameFormat(item.edustage,item.edusubject)} - if(item.itemgroup==="校本课程") { - bookInfo.value.avartar = item.avartar + if(item.fileurl !== ''){ + bookList.value.push(bookInfo.value) } } - if(item.fileurl !== ''){ - bookList.value.push(bookInfo.value) - } }) + console.log(bookList) const textselidx = bookList.value.findIndex(item => item.edustage === edustage && item.edusubject === edusubject) booksel.value = textselidx const filePath = import.meta.env.VITE_APP_RES_FILE_PATH + bookList.value[textselidx].fileurl.replace('.txt','.pdf')