mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-07 01:46:42 +08:00
Compare commits
4 Commits
master-202
...
250408-bug
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b42b08141c | ||
|
|
72837b33c1 | ||
|
|
e293d1cbea | ||
|
|
5406ac26df |
@@ -341,6 +341,13 @@ export const constantRoutes = [{
|
|||||||
name: 'hotforum',
|
name: 'hotforum',
|
||||||
meta: {title: '热点论坛', icon: 'dashboard', noCache: true, affix: true},
|
meta: {title: '热点论坛', icon: 'dashboard', noCache: true, affix: true},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/lexiang',
|
||||||
|
hidden: true,
|
||||||
|
component: (resolve) => require(['@/views/sso/lexiang'], resolve),
|
||||||
|
name: 'lexiang',
|
||||||
|
meta: {title: '单点登录', icon: 'dashboard', noCache: true, affix: true},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/404',
|
path: '/404',
|
||||||
component: (resolve) => require(['@/views/error/404'], resolve),
|
component: (resolve) => require(['@/views/error/404'], resolve),
|
||||||
|
|||||||
53
src/views/sso/lexiang.vue
Normal file
53
src/views/sso/lexiang.vue
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<p v-if="loading">正在跳转,请稍候...</p>
|
||||||
|
<p v-if="error" class="error">{{ errorMessage }}</p>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: true,
|
||||||
|
error: false,
|
||||||
|
errorMessage: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.fetchCode()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async fetchCode() {
|
||||||
|
try {
|
||||||
|
// 替换为你的实际API地址
|
||||||
|
const response = await axios.post('/userbasic/sso/getCode', {})
|
||||||
|
const code = response.data.result
|
||||||
|
if (code) {
|
||||||
|
// 替换为你的目标外部链接,并确保参数名称正确
|
||||||
|
const redirectUrl = `https://lexiangla.com?company_from=d1f3b156e9ed11ef9dc9720f77c5afa9&sso_auth_code=${encodeURIComponent(code)}`
|
||||||
|
window.location.href = redirectUrl
|
||||||
|
} else {
|
||||||
|
this.handleError('未获取到有效code')
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
this.handleError(`请求失败: ${error.message}`)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleError(message) {
|
||||||
|
this.loading = false
|
||||||
|
this.error = true
|
||||||
|
this.errorMessage = message
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.error {
|
||||||
|
color: red;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -593,7 +593,6 @@
|
|||||||
this.onPlayerPause()
|
this.onPlayerPause()
|
||||||
//this.audioPause();
|
//this.audioPause();
|
||||||
this.contentData.lastStudyTime=time;
|
this.contentData.lastStudyTime=time;
|
||||||
//this.onPlayerPlay();
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
$this.$refs.myVideoPlayer.startPlay(time);
|
$this.$refs.myVideoPlayer.startPlay(time);
|
||||||
}, 10)
|
}, 10)
|
||||||
@@ -610,7 +609,6 @@
|
|||||||
if(toResContent){
|
if(toResContent){
|
||||||
|
|
||||||
this.changePlayRes(toResContent);
|
this.changePlayRes(toResContent);
|
||||||
//this.onPlayerPlay();
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
$this.$refs.myVideoPlayer.startPlay(time);
|
$this.$refs.myVideoPlayer.startPlay(time);
|
||||||
}, 10)
|
}, 10)
|
||||||
@@ -1425,9 +1423,7 @@
|
|||||||
//处理内容的名称
|
//处理内容的名称
|
||||||
this.totalContent = rs.result.contents.length;
|
this.totalContent = rs.result.contents.length;
|
||||||
//加载学习的数据
|
//加载学习的数据
|
||||||
//this.loadStudyData();
|
|
||||||
this.loadStudyData(rs.result);
|
this.loadStudyData(rs.result);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(rs.message);
|
this.$message.error(rs.message);
|
||||||
}
|
}
|
||||||
@@ -1644,63 +1640,9 @@
|
|||||||
this.appentInterval = 60
|
this.appentInterval = 60
|
||||||
let totalTime = Math.round((endTime - this.appendStartTime) / 1000);
|
let totalTime = Math.round((endTime - this.appendStartTime) / 1000);
|
||||||
this.appendStudyTime();
|
this.appendStudyTime();
|
||||||
this.saveStudyDuration(totalTime)
|
this.saveStudyDuration(totalTime);
|
||||||
}, this.appentInterval * 1000);
|
}, this.appentInterval * 1000);
|
||||||
},
|
},
|
||||||
//追加学习时长, flag是否提交到后台
|
|
||||||
// appendStudyTime() {
|
|
||||||
// //console.log('开始追加学习时长',this.isAppendTime);
|
|
||||||
// if (this.studyId == '') {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if (!this.contentData.id) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if (!this.isAppendTime) {
|
|
||||||
// this.appendStartTime = null;
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (this.appendHandle != null) {
|
|
||||||
// window.clearTimeout(this.appendHandle);
|
|
||||||
// }
|
|
||||||
// //首先从本地读取
|
|
||||||
// let duration = studyUtil.getStudyDuration();
|
|
||||||
// //console.log('追加学习时长,当前本地积累的学习时长='+duration);
|
|
||||||
// //追加学习长
|
|
||||||
// let $this = this;
|
|
||||||
// if (this.appendStartTime == null) {
|
|
||||||
// this.appendStartTime = new Date();
|
|
||||||
// this.appendHandle = setTimeout(function() {
|
|
||||||
// $this.appendStudyTime();
|
|
||||||
// }, $this.appentInterval); //设置定时追加学习时长
|
|
||||||
// //保存之前的
|
|
||||||
// if (duration >= 60 ) {
|
|
||||||
// this.saveStudyDuration(duration);
|
|
||||||
// }
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// //如果当前追加开始时间不为空
|
|
||||||
// let now = new Date();
|
|
||||||
// let m = now.getTime() - this.appendStartTime.getTime(); //相差的毫秒数
|
|
||||||
// // console.log(m/1000,'时间');
|
|
||||||
|
|
||||||
// let sen = Math.round(m / 1000); //计算秒数
|
|
||||||
// // console.log('定时器时间',sen);
|
|
||||||
// // 每次添加的是定时器计时的时间
|
|
||||||
// duration = duration + sen;//追加的是秒
|
|
||||||
// if (duration >= 60) { //一分钟保存一次
|
|
||||||
// this.saveStudyDuration(duration);
|
|
||||||
// } else {
|
|
||||||
// studyUtil.setStudyDuration(duration); //添加到本地存储中
|
|
||||||
// }
|
|
||||||
// //重新覆盖时间
|
|
||||||
// this.appendStartTime = new Date();
|
|
||||||
// //启动下次追加学习时长
|
|
||||||
// this.appendHandle = setTimeout(function() {
|
|
||||||
// $this.appendStudyTime();
|
|
||||||
// }, $this.appentInterval);
|
|
||||||
// },
|
|
||||||
|
|
||||||
finishStudyItem() { //设置完成学习的内容,针对于音视频的内容
|
finishStudyItem() { //设置完成学习的内容,针对于音视频的内容
|
||||||
if (!this.contentData.studyItemId) {
|
if (!this.contentData.studyItemId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user