Compare commits

..

No commits in common. "e02f67e3e532abf479f9c0747db7f6294bf3bd00" and "83c377fd9eb0d47d2030c66132fe349422c031fa" have entirely different histories.

6 changed files with 37 additions and 67 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "aix-win", "name": "aix-win",
"version": "2.1.12", "version": "2.1.9",
"description": "", "description": "",
"main": "./out/main/index.js", "main": "./out/main/index.js",
"author": "example.com", "author": "example.com",

View File

@ -246,10 +246,8 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) {
/*创建新的ppt文件*/ /*创建新的ppt文件*/
ipcMain.on('creat-ai-file-default', (e, { name, url, uploadData, cookie }) => { ipcMain.on('creat-ai-file-default', (e, { name, url, uploadData, cookie }) => {
createFolder('tempFile').then(async () => { createFolder('tempFile').then(async () => {
let lastname = decodeURIComponent(url);
name = lastname.substring(lastname.lastIndexOf("/")+1)
let path = appTempFilePath + name.replace(/[\\/:*?"<>|]/, '') let path = appTempFilePath + name.replace(/[\\/:*?"<>|]/, '')
let {type,item} = await downloadFiles(url,name) let {type,item} = await downloadFile(url,name)
if (type==="成功") { if (type==="成功") {
let fileType = 'application/vnd.openxmlformats-officedocument.presentationml.presentation' let fileType = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
let formData = new FormData() let formData = new FormData()
@ -281,8 +279,7 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) {
}) })
}) })
function downloadFiles(url,fileName) { function downloadFile(url,fileName) {
console.log(url,fileName)
return new Promise((resolve, reject)=>{ return new Promise((resolve, reject)=>{
const browserWindow = BrowserWindow.getFocusedWindow() const browserWindow = BrowserWindow.getFocusedWindow()
const id = manager.download({ const id = manager.download({

View File

@ -1,49 +1,27 @@
import axios from "axios"; import axios from "axios";
import { getSignature } from "./index"; import { getSignature } from "./index";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import request from '@/utils/request'
let appId = "01ec9aa3"; let appId = "01ec9aa3";
let secret = "M2QxMDAxMjYyYTEzODMwMGRkZTQ4NmUy"; let secret = "M2QxMDAxMjYyYTEzODMwMGRkZTQ4NmUy";
let timestamp = Math.floor(Date.now() / 1000); let timestamp = Math.floor(Date.now() / 1000);
let signature = getSignature(appId, secret, timestamp); let signature = getSignature(appId, secret, timestamp);
let req = (url, type, data)=>{
let config = {
headers: {
"Content-Type": "application/json",
appId: appId,
timestamp: timestamp,
signature: signature,
},
url: url,
method: type,
}
if (type === "GET") {
config.params = data;
} else {
config.data = data;
}
return request(config)
}
/*const instance = axios.create({ const instance = axios.create({
// baseURL: import.meta.env.VITE_APP_ENV === "development"?"/parth":import.meta.env.VITE_APP_BASE_API, baseURL: "",
baseURL: "/dev-api",
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
'Authorization': 'Bearer ' + getToken(),
appId: appId, appId: appId,
timestamp: timestamp, timestamp: timestamp,
signature: signature, signature: signature,
}, },
});*/ });
const createOutline = async (data) => { const createOutline = async (data) => {
console.log("createOutline data:", data); console.log("createOutline data:", data);
try { try {
const response = await req( const response = await instance.post(
"/api/aippt/createOutline", "/parth/api/aippt/createOutline",
"POST",
data data
); );
console.log("createOutline response:", response); console.log("createOutline response:", response);
@ -58,7 +36,7 @@ const createOutline = async (data) => {
}; };
const getBackGround = async () => { const getBackGround = async () => {
try { try {
const response = await req("/api/aippt/themeList", "GET"); const response = await instance.get("/parth/api/aippt/themeList");
return response.data; return response.data;
} catch (error) { } catch (error) {
console.error("请求失败:", error); console.error("请求失败:", error);
@ -67,7 +45,7 @@ const getBackGround = async () => {
}; };
const createPPT = async (data) => { const createPPT = async (data) => {
try { try {
const response = await req("/api/aippt/create", "POST", data); const response = await instance.post("/parth/api/aippt/create", data);
console.log("createOutline response:", response); console.log("createOutline response:", response);
return response.data; return response.data;
@ -78,7 +56,7 @@ const createPPT = async (data) => {
}; };
const createByOutline = async (data) => { const createByOutline = async (data) => {
try { try {
const response = await req("/api/aippt/createByOutline","POST", data); const response = await instance.post("/parth/api/aippt/createByOutline", data);
console.log("createByOutline response:", response); console.log("createByOutline response:", response);
return response.data; return response.data;
@ -89,7 +67,7 @@ const createByOutline = async (data) => {
}; };
const getProgress = async (id) => { const getProgress = async (id) => {
try { try {
const response = await req(`/api/aippt/progress?sid=${id}`, "GET"); const response = await instance.get(`/parth/api/aippt/progress?sid=${id}`);
return response.data; return response.data;
} catch (error) { } catch (error) {
console.error("请求失败:", error); console.error("请求失败:", error);
@ -97,4 +75,4 @@ const getProgress = async (id) => {
} }
}; };
export { createOutline, getBackGround, createPPT, getProgress, createByOutline }; export { instance, createOutline, getBackGround, createPPT, getProgress, createByOutline };

View File

@ -178,7 +178,7 @@ const getBackground = () => {
treeData.value = []; treeData.value = [];
getBackGround().then((res) => { getBackGround().then((res) => {
console.log(res); console.log(res);
backGroundList.value = res; backGroundList.value = res.data;
}); });
}; };
@ -222,14 +222,14 @@ const outlineCreatePPT = () => {
activeStep.value = 4 activeStep.value = 4
const checkProgress = () => { const checkProgress = () => {
getProgress(res.sid).then((response) => { getProgress(res.data.sid).then((response) => {
percentage.value = response.process; percentage.value = response.data.process;
if (response && response.pptUrl && response.pptUrl.length > 4) { if (response.data && response.data.pptUrl && response.data.pptUrl.length > 4) {
console.log('PPT',response) console.log('PPT',response)
// window.location.href = response.data.pptUrl; // window.location.href = response.data.pptUrl;
//URLURL //URLURL
// let url = "https://bjcdn.openstorage.cn/xinghuo-privatedata/%2Ftmp/apiTempFiledf28bf990a4c40ffb7477ed4b65392c27232357022409613439/%E3%80%8A%E9%9D%99%E5%A5%B3%E3%80%8B%E6%B7%B1%E5%BA%A6%E8%A7%A3%E8%AF%BB%E4%B8%8E%E7%A0%94%E7%A9%B6.pptx" // let url = "https://bjcdn.openstorage.cn/xinghuo-privatedata/%2Ftmp/apiTempFiledf28bf990a4c40ffb7477ed4b65392c27232357022409613439/%E3%80%8A%E9%9D%99%E5%A5%B3%E3%80%8B%E6%B7%B1%E5%BA%A6%E8%A7%A3%E8%AF%BB%E4%B8%8E%E7%A0%94%E7%A9%B6.pptx"
creatAIPPT(props.currentNode.itemtitle + '.pptx',response.pptUrl, props.uploadData).then((res) => { creatAIPPT(props.currentNode.itemtitle + '.pptx',response.data.pptUrl, props.uploadData).then((res) => {
emit('addSuccess',res) emit('addSuccess',res)
}) })
ElMessage.success("生成成功"); ElMessage.success("生成成功");

View File

@ -7,7 +7,7 @@
<el-image class="imges" :src="bookInfo ? bookInfo.avartar : ''" /> <el-image class="imges" :src="bookInfo ? bookInfo.avartar : ''" />
</div> </div>
<div class="stand-head-right"> <div class="stand-head-right">
<div class="stand-head-right-tit">{{bookInfo ? bookInfo.itemtitle : ''}}</div> <div class="stand-head-right-tit">{{bookInfo ? bookInfo.bookName : ''}}</div>
<i class="iconfont icon-yidongdaozu stand-head-right-icon" @click="dialogVisible = true"></i> <i class="iconfont icon-yidongdaozu stand-head-right-icon" @click="dialogVisible = true"></i>
<div class="stand-head-right-row"> <div class="stand-head-right-row">
<div class="stand-head-right-row-time">更新2024.9.10</div> <div class="stand-head-right-row-time">更新2024.9.10</div>
@ -72,7 +72,7 @@
<div class="booklist"> <div class="booklist">
<div :class="{'item': true,'active': booksel === idx}" v-for="item,idx in bookList" :key="idx" @click="bookChange(item,idx)"> <div :class="{'item': true,'active': booksel === idx}" v-for="item,idx in bookList" :key="idx" @click="bookChange(item,idx)">
<el-image class="bookimg" :src="item.avartar" /> <el-image class="bookimg" :src="item.avartar" />
<div class="bookname">{{item.itemtitle}}</div> <div class="bookname">{{item.bookName}}</div>
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
@ -173,7 +173,7 @@ const selectHandel = (value) => {
} }
//json //json
const saveJSON = (data) => { const saveJSON = (data) => {
let filename = '' let filename = ''
// const data = { // const data = {
// name: 'txt', // name: 'txt',
@ -247,12 +247,11 @@ const getAllSubject = async () => {
rows && rows.map(item => { rows && rows.map(item => {
if(edustage === item.edustage && item.edusubject === edusubject){ 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)} bookInfo.value = {...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar,bookName: bookNameFormat(item.edustage,item.edusubject)}
if(item.fileurl !== ''){ }
bookList.value.push(bookInfo.value) if(item.fileurl !== ''){
} bookList.value.push({...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar,bookName: bookNameFormat(item.edustage,item.edusubject)})
} }
}) })
console.log(bookList)
const textselidx = bookList.value.findIndex(item => item.edustage === edustage && item.edusubject === edusubject) const textselidx = bookList.value.findIndex(item => item.edustage === edustage && item.edusubject === edusubject)
booksel.value = textselidx booksel.value = textselidx
const filePath = import.meta.env.VITE_APP_RES_FILE_PATH + bookList.value[textselidx].fileurl.replace('.txt','.pdf') const filePath = import.meta.env.VITE_APP_RES_FILE_PATH + bookList.value[textselidx].fileurl.replace('.txt','.pdf')
@ -283,7 +282,7 @@ onMounted(async () => {
const searchh = searchref.value.offsetHeight; const searchh = searchref.value.offsetHeight;
listHeight.value = Math.floor(cardH) - Math.floor(headh) - Math.floor(searchh) - 60; listHeight.value = Math.floor(cardH) - Math.floor(headh) - Math.floor(searchh) - 60;
} }
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
if(cardref.value && headref.value){ if(cardref.value && headref.value){
const cardH = cardref.value.offsetHeight; const cardH = cardref.value.offsetHeight;
@ -334,9 +333,9 @@ onMounted(async () => {
console.log('转换后整体文字------',StartStr + midStr + EndStr); console.log('转换后整体文字------',StartStr + midStr + EndStr);
} }
}) })
// const isDev = process.env.NODE_ENV == 'development' // const isDev = process.env.NODE_ENV == 'development'
// if (isDev) // if (isDev)
// pdfUrl.value = '/'+getStaticUrl('aaa.pdf', 'user', 'selfFile', true) // pdfUrl.value = '/'+getStaticUrl('aaa.pdf', 'user', 'selfFile', true)
// else // else
// pdfUrl.value = getStaticUrl(route.query.path, 'user', 'selfFile', true) // pdfUrl.value = getStaticUrl(route.query.path, 'user', 'selfFile', true)
@ -553,4 +552,4 @@ onMounted(async () => {
color: #ffffff; color: #ffffff;
} }
} }
</style> </style>

View File

@ -7,7 +7,7 @@
<el-image class="imges" :src="bookInfo ? bookInfo.avartar : ''" /> <el-image class="imges" :src="bookInfo ? bookInfo.avartar : ''" />
</div> </div>
<div class="stand-head-right"> <div class="stand-head-right">
<div class="stand-head-right-tit">{{bookInfo ? bookInfo.itemtitle: ''}}</div> <div class="stand-head-right-tit">{{bookInfo ? bookInfo.bookName: ''}}</div>
<i class="iconfont icon-yidongdaozu stand-head-right-icon" @click="dialogVisible = true"></i> <i class="iconfont icon-yidongdaozu stand-head-right-icon" @click="dialogVisible = true"></i>
<div class="stand-head-right-row"> <div class="stand-head-right-row">
<div class="stand-head-right-row-time">更新2024.9.10</div> <div class="stand-head-right-row-time">更新2024.9.10</div>
@ -72,7 +72,7 @@
<div class="booklist"> <div class="booklist">
<div :class="{'item': true,'active': booksel === idx}" v-for="item,idx in bookList" :key="idx" @click="bookChange(item,idx)"> <div :class="{'item': true,'active': booksel === idx}" v-for="item,idx in bookList" :key="idx" @click="bookChange(item,idx)">
<el-image class="bookimg" :src="item.avartar" /> <el-image class="bookimg" :src="item.avartar" />
<div class="bookname">{{item.itemtitle}}</div> <div class="bookname">{{item.bookName}}</div>
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
@ -175,7 +175,7 @@ const selectHandel = (value) => {
} }
//json //json
const saveJSON = (data) => { const saveJSON = (data) => {
let filename = '' let filename = ''
// const data = { // const data = {
// name: 'txt', // name: 'txt',
@ -249,11 +249,7 @@ const getAllSubject = async () => {
const dataList = []; const dataList = [];
rows && rows.map((item,idx) => { rows && rows.map((item,idx) => {
if(item.fileurl !== ''){ if(item.fileurl !== ''){
let infos = {...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar,bookName: item.fileurl.replace('.txt','')} dataList.push({...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar,bookName: item.fileurl.replace('.txt','')})
if(infos.itemgroup==="校本课程") {
infos.avartar = item.avartar
}
dataList.push(infos)
} }
}) })
bookList.value = dataList bookList.value = dataList
@ -269,7 +265,7 @@ const getAllSubject = async () => {
bookInfo.value = {...dataList[0]} bookInfo.value = {...dataList[0]}
filePath += dataList[0].fileurl.replace('.txt','.pdf') filePath += dataList[0].fileurl.replace('.txt','.pdf')
} }
await loadPdfAnimation(filePath) await loadPdfAnimation(filePath)
}else{ }else{
bookInfo.value = {...dataList[0]} bookInfo.value = {...dataList[0]}
filePath += dataList[0].fileurl.replace('.txt','.pdf') filePath += dataList[0].fileurl.replace('.txt','.pdf')
@ -299,7 +295,7 @@ onMounted(async () => {
const searchh = searchref.value.offsetHeight; const searchh = searchref.value.offsetHeight;
listHeight.value = Math.floor(cardH) - Math.floor(headh) - Math.floor(searchh) - 60; listHeight.value = Math.floor(cardH) - Math.floor(headh) - Math.floor(searchh) - 60;
} }
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
if(cardref.value && headref.value){ if(cardref.value && headref.value){
const cardH = cardref.value.offsetHeight; const cardH = cardref.value.offsetHeight;
@ -350,9 +346,9 @@ onMounted(async () => {
console.log('转换后整体文字------',StartStr + midStr + EndStr); console.log('转换后整体文字------',StartStr + midStr + EndStr);
} }
}) })
// const isDev = process.env.NODE_ENV == 'development' // const isDev = process.env.NODE_ENV == 'development'
// if (isDev) // if (isDev)
// pdfUrl.value = '/'+getStaticUrl('aaa.pdf', 'user', 'selfFile', true) // pdfUrl.value = '/'+getStaticUrl('aaa.pdf', 'user', 'selfFile', true)
// else // else
// pdfUrl.value = getStaticUrl(route.query.path, 'user', 'selfFile', true) // pdfUrl.value = getStaticUrl(route.query.path, 'user', 'selfFile', true)
@ -574,4 +570,4 @@ onMounted(async () => {
color: #ffffff; color: #ffffff;
} }
} }
</style> </style>