Commit 710265e9 by 胡悦

refactor(studyDetail): Enhance token management and exam handling

- Introduced tokenUrl state to manage SSO token retrieval more efficiently.
- Updated openCourse method to fetch a new token each time to prevent expiration.
- Modified handleExam method to skip processing for items with the tag '服务意识'.
1 parent 1f5ea2b6
......@@ -91,6 +91,7 @@ export default {
webviewHistory: [],
pageData: {},
nothing: false,
tokenUrl: ''
}
},
computed: {
......@@ -143,9 +144,10 @@ export default {
}
uni.navigateBack()
},
openCourse(index, item) {
async openCourse(index, item) {
console.log(index, 'index')
this.selectedIndex = index;
this.tokenUrl = await this.findBeiSenSSOToken() // 每次都重新获取token,防止过期
// const arr = ['80cb90d7-1609-4360-8f23-6c47ddba41c0', '17983a1a-5bcd-4e7d-a180-061ef3f9a49d']
// 只更换url
this.handleOperation(item.courseId);
......@@ -164,7 +166,7 @@ export default {
})
})
},
async handleOperation(courseId) {
handleOperation(courseId) {
// 只处理课程详情,设置jumpUrl
const COURSE_ID = courseId;
const baseUrl = 'https://cloud.italent.cn/PageHome/Index';
......@@ -179,8 +181,8 @@ export default {
const queryString = Object.entries(params)
.map(([key, value]) => `${key}=${value}`)
.join('&');
// const tokenUrl = uni.$storage.get('beisenToken')
const tokenUrl = await this.findBeiSenSSOToken() // 每次都重新获取token,防止过期
const tokenUrl = this.tokenUrl || uni.$storage.get('beisenToken')
// this.setWebviewStyle()
const url = encodeURIComponent(`${baseUrl}?${queryString}#/viewDynamic?1=1`);
this.jumpUrl = `${tokenUrl}&return_url=${url}`;
......
......@@ -450,6 +450,9 @@ export default {
},
async handleExam (item) {
console.log(item, '===')
if (item.tagName == '服务意识') {
return
}
const { checkDate } = this.rowData
const { businessType, brandType } = this.courseDetail
let { agentUrl, domainName, taskStatus, agentCode } = this.aiAgentData
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!