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 { ...@@ -91,6 +91,7 @@ export default {
webviewHistory: [], webviewHistory: [],
pageData: {}, pageData: {},
nothing: false, nothing: false,
tokenUrl: ''
} }
}, },
computed: { computed: {
...@@ -143,9 +144,10 @@ export default { ...@@ -143,9 +144,10 @@ export default {
} }
uni.navigateBack() uni.navigateBack()
}, },
openCourse(index, item) { async openCourse(index, item) {
console.log(index, 'index') console.log(index, 'index')
this.selectedIndex = index; this.selectedIndex = index;
this.tokenUrl = await this.findBeiSenSSOToken() // 每次都重新获取token,防止过期
// const arr = ['80cb90d7-1609-4360-8f23-6c47ddba41c0', '17983a1a-5bcd-4e7d-a180-061ef3f9a49d'] // const arr = ['80cb90d7-1609-4360-8f23-6c47ddba41c0', '17983a1a-5bcd-4e7d-a180-061ef3f9a49d']
// 只更换url // 只更换url
this.handleOperation(item.courseId); this.handleOperation(item.courseId);
...@@ -164,7 +166,7 @@ export default { ...@@ -164,7 +166,7 @@ export default {
}) })
}) })
}, },
async handleOperation(courseId) { handleOperation(courseId) {
// 只处理课程详情,设置jumpUrl // 只处理课程详情,设置jumpUrl
const COURSE_ID = courseId; const COURSE_ID = courseId;
const baseUrl = 'https://cloud.italent.cn/PageHome/Index'; const baseUrl = 'https://cloud.italent.cn/PageHome/Index';
...@@ -179,8 +181,8 @@ export default { ...@@ -179,8 +181,8 @@ export default {
const queryString = Object.entries(params) const queryString = Object.entries(params)
.map(([key, value]) => `${key}=${value}`) .map(([key, value]) => `${key}=${value}`)
.join('&'); .join('&');
// const tokenUrl = uni.$storage.get('beisenToken') const tokenUrl = this.tokenUrl || uni.$storage.get('beisenToken')
const tokenUrl = await this.findBeiSenSSOToken() // 每次都重新获取token,防止过期 // this.setWebviewStyle()
const url = encodeURIComponent(`${baseUrl}?${queryString}#/viewDynamic?1=1`); const url = encodeURIComponent(`${baseUrl}?${queryString}#/viewDynamic?1=1`);
this.jumpUrl = `${tokenUrl}&return_url=${url}`; this.jumpUrl = `${tokenUrl}&return_url=${url}`;
......
...@@ -450,6 +450,9 @@ export default { ...@@ -450,6 +450,9 @@ export default {
}, },
async handleExam (item) { async handleExam (item) {
console.log(item, '===') console.log(item, '===')
if (item.tagName == '服务意识') {
return
}
const { checkDate } = this.rowData const { checkDate } = this.rowData
const { businessType, brandType } = this.courseDetail const { businessType, brandType } = this.courseDetail
let { agentUrl, domainName, taskStatus, agentCode } = this.aiAgentData 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!