This commit is contained in:
caoyuchun 2024-07-10 16:49:16 +08:00
parent 3d05276026
commit 7099f45d36
3 changed files with 81 additions and 17 deletions

View File

@ -39,6 +39,16 @@ var bookinfo ={
data: params,
})
},
// 集合
json: (params) =>{
return request({
url :`${prefix}/smile/get/remote/book/jsom/url`,
method :'GET',
data : params
})
}
}
// 笔记

View File

@ -112,6 +112,9 @@ export default {
created() {
this.bookId = this.$route.query.bookId
if (this.$route.query.chapterId){
this.chapterId = this.$route.query.chapterId
}
// this.userType = this.$route.query.userType || 'student'
this.$store.state.redirecturl = this.$route.query.redirecturl
var userType = getStore("userType")
@ -160,34 +163,66 @@ export default {
// this.location = locationData.location
var res = await bookApi.bookinfo.json({bookId:this.bookId})
// res = JSON.stringify(res)
// res = res.replaceAll("https://smile-ebook.oss-cn-qingdao.aliyuncs.com/", "fileapi/")
// res = JSON.parse(res)
try {
this.textBookData = await bookApi.bookinfo.detail({bookId:this.bookId})
this.$store.state.textBookData = this.textBookData
if (res){
var res1 = await fetch(res.LOCAL_VIEW_DETAIL,{
mode: 'cors'
})
this.textBookData = await res1.json()
var res2 = await fetch (res.LOCAL_VIEW_CATALOG,{
mode: 'cors'
})
debugger
this.catalogList = await res2.json()
var res3 = await fetch(res.LOCAL_VIEW_DATA,{
mode: 'cors'
})
} catch (error) {
this.fullscreenLoading = false
this.show= false
this.showError = true
this.errormsg = error
this.$message.error(error);
console.log(this.catalogList)
this.looseLeafData = await res3.json()
this.basisPath = res.basisPath
debugger
}
debugger
// debugger
// console.log(res)
// return
// try {
// this.textBookData = await bookApi.bookinfo.detail({bookId:this.bookId})
// this.$store.state.textBookData = this.textBookData
// } catch (error) {
// this.fullscreenLoading = false
// this.show= false
// this.showError = true
// this.errormsg = error
// this.$message.error(error);
// }
debugger
this.basisPath = this.textBookData.basisPath
this.catalogList = await bookApi.bookinfo.category({bookId:this.bookId})
this.looseLeafData = await bookApi.bookinfo.data({bookId:this.bookId})
this.show = true
this.fullscreenLoading = false
// this.catalogList = await bookApi.bookinfo.category({bookId:this.bookId})
// this.looseLeafData = await bookApi.bookinfo.data({bookId:this.bookId})
this.data.resources.list = await bookApi.resource.list({bookId:this.bookId})
this.digitalTeaching = true
if (this.$route.query.chapterId){
this.chapterId = this.$route.query.chapterId
}
this.show = true
this.fullscreenLoading = false
this.digitalTeaching = true
},
methods: {

View File

@ -19,8 +19,27 @@ module.exports = {
});
console.log('Proxy response:', res.statusCode);
}
},
'/remote':{
target : "https://smile-ebook.oss-cn-qingdao.aliyuncs.com",
changeOrigin : true,
pathRewrite: {
'^/remote': '/'
},
logLevel : 'debug',
onProxyRes(proxyRes, req, res) {
let responseBody = '';
proxyRes.on('data', (chunk) => {
responseBody += chunk;
});
proxyRes.on('end', () => {
// console.log('Proxy response body:', responseBody);
});
console.log('Proxy response:', res.statusCode);
}
}
}
},
configureWebpack:(config)=>{