作业布置

This commit is contained in:
lyc 2024-08-13 16:14:41 +08:00
parent 2b5acf272d
commit bc5a6e961d
2 changed files with 13 additions and 28 deletions

View File

@ -126,12 +126,8 @@ async function createLinkWin(data) {
let cookieDetails = { ...data.cookieData } let cookieDetails = { ...data.cookieData }
await linkWin[data.key].webContents.session.cookies await linkWin[data.key].webContents.session.cookies
.set(cookieDetails) .set(cookieDetails)
.then(() => { .then(() => {})
console.log('Cookie is successful') .catch((error) => {})
})
.catch((error) => {
console.error('Cookie is error', error)
})
data.fullPath = data.fullPath.replaceAll('//', '/') data.fullPath = data.fullPath.replaceAll('//', '/')
linkWin[data.key].loadURL(data.fullPath) linkWin[data.key].loadURL(data.fullPath)

View File

@ -192,7 +192,6 @@ export default {
// //
userStore: '', userStore: '',
entpcourseid: '', entpcourseid: '',
timerId: null,
// //
setDialog: false, setDialog: false,
row: '' row: ''
@ -205,13 +204,7 @@ export default {
) )
} }
}, },
watch: {
$route(to) {
if (to.path != '/prepare' && this.timerId) {
clearInterval(this.timerId)
}
}
},
created() { created() {
this.userStore = useUserStore().user this.userStore = useUserStore().user
ipcRenderer.removeAllListeners('copy-file-default-reply') ipcRenderer.removeAllListeners('copy-file-default-reply')
@ -229,6 +222,13 @@ export default {
setTimeout(this.initReserv, 500) setTimeout(this.initReserv, 500)
} }
) )
// electron
const curWin = Remote.getCurrentWindow()
curWin.on('focus', ()=>{
this.initHomeWork()
})
}, },
// activated() { // activated() {
// if (this.uploadData.textbookId !== null) { // if (this.uploadData.textbookId !== null) {
@ -423,9 +423,7 @@ export default {
await this.asyncAllFile() await this.asyncAllFile()
}, },
async initHomeWork() { async initHomeWork() {
if (this.timerId) {
clearInterval(this.timerId)
}
if (this.uploadData.levelSecondId) { if (this.uploadData.levelSecondId) {
// ID // ID
let { rows } = await this.getChapterId() let { rows } = await this.getChapterId()
@ -468,10 +466,7 @@ export default {
}, },
// //
handleOutLink(key) { handleOutLink(key) {
if (key == 'homeWork') {
//
this.createTimer()
}
// key linkConfig.js // key linkConfig.js
let configObj = outLink()[key] let configObj = outLink()[key]
// //
@ -483,19 +478,13 @@ export default {
}, },
// ID ID // ID ID
getChapterId() { getChapterId() {
console.log(this.userStore, 'this.userStore')
return listEntpcourse({ return listEntpcourse({
evalid: this.uploadData.levelSecondId, evalid: this.uploadData.levelSecondId,
edituserid: this.userStore.userId, edituserid: this.userStore.userId,
pageSize: 500 pageSize: 500
}) })
}, },
//
createTimer() {
this.timerId = setInterval(() => {
this.getHomeWorkList()
}, 2500)
},
// //
getHomeWorkList() { getHomeWorkList() {
homeworklist({ homeworklist({