讲师工作台
@@ -68,13 +68,17 @@
import {defineComponent, reactive, ref} from 'vue'
import teacherApplyUpload from './Upload/TeacherApplyUpload';
import { ElMessage } from 'element-plus'
-import { addTeacher, getTeacherInfo, editTeacher, getUserInfo } from "../../api/teacher"
+import { addTeacher, getTeacherInfo, editTeacher, judgeIsTeacher } from "../../api/teacher"
export default defineComponent({
name: 'TeacherApplyModal',
+ props:{
+ uid:undefined
+ },
components:{
teacherApplyUpload
},
- setup() {
+ setup(props) {
+ const isTeacher = ref(false);
const dialogVisible = ref(false);
const qrDialogVisible = ref(false);
const submitLoading = ref(false);
@@ -87,29 +91,31 @@ export default defineComponent({
introduction: '',
avatar:'',
})
- const showModal = () => {
- dialogVisible.value = true
+ const judgeIfTeacher = async () => {
+ const judgeRes = await judgeIsTeacher(props.uid)
+ if (judgeRes.code === 200){
+ isTeacher.value = judgeRes.data;
+ }
}
- // 获取讲师资料
+ judgeIfTeacher();
const getInfo = async () => {
- const userInfoRes = await getUserInfo();
+ console.log('获取用户资料');
const res = await getTeacherInfo();
- if (userInfoRes.code === 200 && userInfoRes.data){
- const {mobile} = userInfoRes.data;
- form.phone = mobile;
- }
if (res.code === 200 && res.data){
- const {name = '', avatar = '',introduction = '', id= ''} = res.data;
+ const {name = '', avatar = '',introduction = '', id= '', phone=''} = res.data;
+ form.phone = phone;
form.name = name;
form.avatar = avatar;
form.introduction = introduction;
form.teacherId = id;
form.status=res.data.approvalState;
}
- console.log('讲师资料是');
- console.log(res);
}
- getInfo();
+ const showModal = () => {
+ getInfo();
+ dialogVisible.value = true
+ }
+ // 获取讲师资料
const rules = reactive({
name: [
{ required: true, message: '请输入讲师姓名', trigger: 'blur' },
@@ -168,6 +174,7 @@ export default defineComponent({
})
}
return {
+ isTeacher,
dialogVisible,
form,
ruleFormRef,
diff --git a/src/components/msgLogin.vue b/src/components/msgLogin.vue
index b9a2f10..08487d6 100644
--- a/src/components/msgLogin.vue
+++ b/src/components/msgLogin.vue
@@ -2,7 +2,7 @@
- 无权限查看,当前页面需要
登录
+ 无权限查看,当前页面需要
登录
diff --git a/src/main.js b/src/main.js
index 0c4db1b..4c278de 100644
--- a/src/main.js
+++ b/src/main.js
@@ -4,7 +4,6 @@ import 'dayjs/locale/zh-cn'
import locale from 'element-plus/lib/locale/lang/zh-cn'
import 'element-plus/lib/theme-chalk/index.css';
import './assets/icons'
-//import 'element-plus/dist/index.css'
import App from './App.vue';
import router from './router';
import store from './store';
diff --git a/src/mixins/mixins.js b/src/mixins/mixins.js
index cc66f1a..950d256 100644
--- a/src/mixins/mixins.js
+++ b/src/mixins/mixins.js
@@ -7,6 +7,8 @@
*/
//import { getToken } from "@/utils/cookie";
import store from '@/store'
+// import { useRoute } from 'vue-router'
+
export const mixins = {
data() {
return {
@@ -17,7 +19,8 @@ export const mixins = {
com_node_env: process.env.VUE_APP_ENV || 'production',
com_pass_url: process.env.VUE_APP_PASS_URL || 'https://fanruanclub.com',
com_cert_url:process.env.VUE_APP_CERT_URL || 'https://cert.fanruan.com',
- com_jump_url:encodeURIComponent(window.location.href)
+ com_jump_url:encodeURIComponent(window.location.href),
+ com_login_url:process.env.VUE_APP_ID_URL+'/signin/'+'?app=edu&protocol=cas&referrer='+window.location.href
}
},
created() {
diff --git a/src/router-jump-cas.js b/src/router-jump-cas.js
new file mode 100644
index 0000000..d0d0ad6
--- /dev/null
+++ b/src/router-jump-cas.js
@@ -0,0 +1,439 @@
+import { createRouter, createWebHistory } from 'vue-router';
+import Layout from '@/layout/index.vue';
+import store from '@/store';
+import { refreshToken, casLogin } from '@/api/auth';
+import '@/utils/fineClubSDK';
+import { getUid, getExpiresTime } from '@/utils/cookie';
+import { delUrlParams } from '@/utils/urlQuery';
+
+const routes = [
+ {
+ path: '/',
+ name: 'index',
+ component: Layout,
+ children: [
+ {
+ path: '/',
+ name: 'index',
+ component: () => import('@/views/index.vue'),
+ meta: {
+ title: '帆软学院-培养企业亟需的数据人才',
+ isMobile: 1,
+ },
+ },
+
+ {
+ path: '/cityclass',
+ name: 'cityclass',
+ component: () => import('@/views/cityclass.vue'),
+ meta: {
+ title: '城市课堂 - 帆软学院',
+ active: 'cityclass',
+ },
+ },
+
+ /**
+ * 视频课
+ */
+ {
+ path: '/video',
+ name: 'videoindex',
+ component: () => import('@/views/video/indexVideo.vue'),
+ meta: {
+ title: '视频课 - 帆软学院',
+ isMobile: 1,
+ },
+ },
+ {
+ path: '/video/:courseid',
+ name: 'video_course',
+ component: () => import('@/views/video/video_course.vue'),
+ meta: {
+ title: '视频课 - 帆软学院',
+ active: 'video',
+ isMobile: 1,
+ },
+ },
+ {
+ path: '/video/play/:playid',
+ name: 'video_course_play',
+ component: () => import('@/views/video/play.vue'),
+ meta: {
+ title: '播放课程 - 视频课',
+ active: 'video',
+ isMobile: 1,
+ },
+ },
+ /**
+ * 班级
+ */
+ {
+ path: '/class',
+ name: 'StudyClass',
+ component: () => import('@/views/class/indexClass.vue'),
+ meta: {
+ title: '学习班 - 帆软学院',
+ },
+ },
+
+ /**
+ * 进入班级教室
+ */
+ {
+ path: '/class/:classid',
+ name: 'layoutClass',
+ component: () => import('@/views/class/class.vue'),
+ meta: {
+ title: '课程章节 - 学习班',
+ active: 'class',
+ },
+ children: [
+ {
+ path: '/class/:classid',
+ name: 'class_lesson',
+ component: () => import('@/views/class/class_lesson.vue'),
+ meta: {
+ title: '课程章节 - 学习班',
+ active: 'class',
+ tab: 'class_lesson',
+ },
+ },
+ {
+ path: '/class/homework/:classid',
+ name: 'class_homework',
+ component: () => import('@/views/class/class_homework.vue'),
+ meta: {
+ title: '我的作业 - 学习班',
+ active: 'class',
+ },
+ },
+ {
+ path: '/class/forum/:classid',
+ name: 'class_forum',
+ component: () => import('@/views/class/class_forum.vue'),
+ meta: {
+ title: '班级论坛 - 学习班',
+ active: 'class',
+ tab: 'class_forum',
+ },
+ },
+ {
+ path: '/class/forum/:classid/:tid',
+ name: 'class_forum_thread',
+ component: () => import('@/views/class/class_forum_thread.vue'),
+ meta: {
+ title: '班级论坛 - 学习班',
+ active: 'class',
+ tab: 'class_forum',
+ },
+ },
+ ],
+ },
+ /**
+ * 老师后台管理
+ */
+ {
+ path: '/class/admin/:classid',
+ name: 'adminLayoutClass',
+ component: () => import('@/views/class/admin/index_admin_class.vue'),
+ meta: {
+ title: '学生管理 - 学习班',
+ active: 'class',
+ },
+ children: [
+ {
+ path: '/class/admin/student/:classid',
+ name: 'student_admin_class',
+ component: () =>
+ import('@/views/class/admin/student_admin_class.vue'),
+ meta: {
+ title: '学生管理 - 学习班',
+ active: 'class',
+ },
+ },
+ {
+ path: '/class/admin/homework/:classid',
+ name: 'homework_admin_class',
+ component: () =>
+ import('@/views/class/admin/homework_admin_class.vue'),
+ meta: {
+ title: '批改作业 - 学习班',
+ active: 'class',
+ },
+ },
+ {
+ path: '/class/admin/schedule/:classid',
+ name: 'schedule_admin_class',
+ component: () =>
+ import('@/views/class/admin/schedule_admin_class.vue'),
+ meta: {
+ title: '教学进度管理 - 学习班',
+ active: 'class',
+ },
+ },
+ {
+ path: '/class/admin/notice/:classid',
+ name: 'notice_admin_class',
+ component: () =>
+ import('@/views/class/admin/notice_admin_class.vue'),
+ meta: {
+ title: '公告栏管理 - 学习班',
+ active: 'class',
+ },
+ },
+ ],
+ },
+
+ /**
+ * 直播
+ */
+ {
+ path: '/live',
+ name: 'live',
+ component: () => import('@/views/live/live.vue'),
+ meta: {
+ title: '直播 - 帆软学院',
+ },
+ },
+
+ {
+ path: '/live/:liveid',
+ name: 'live_view',
+ component: () => import('@/views/live/live_view.vue'),
+ meta: {
+ title: '直播 - 帆软学院',
+ active: 'live',
+ isMobile: 1,
+ },
+ },
+ // 资源导航
+ {
+ path: '/more',
+ name: 'more',
+ component: () => import('@/views/more.vue'),
+ meta: {
+ title: '资源导航 - 帆软学院',
+ active: 'more',
+ },
+ },
+
+ // 新手入门-地图 finereport
+ {
+ path: '/guide/finereport',
+ name: 'guide_finereport',
+ component: () => import('@/views/video/guide/finereport.vue'),
+ meta: {
+ title: 'FineReport入门学习路径 - 帆软学院',
+ active: 'studypath',
+ },
+ },
+
+ // 新手入门-地图 finebi
+ {
+ path: '/guide/finebi',
+ name: 'guide_finebi',
+ component: () => import('@/views/video/guide/finebi.vue'),
+ meta: {
+ title: 'FineBI入门学习路径 - 帆软学院',
+ active: 'studypath',
+ },
+ },
+
+ // 新手入门-地图 jiandaoyun
+ {
+ path: '/guide/jiandaoyun',
+ name: 'guide_jiandaoyun',
+ component: () => import('@/views/video/guide/jiandaoyun.vue'),
+ meta: {
+ title: '简道云入门学习路径 - 帆软学院',
+ active: 'studypath',
+ },
+ },
+
+ // fr-学习路径首页
+ {
+ path: '/studypath/finereport',
+ name: 'studypathfr',
+ component: () => import('@/views/studypath/finereport.vue'),
+ meta: {
+ title: '报表开发工程师 - 学习路径 - 帆软学院',
+ active: 'studypath',
+ isMobile: 1,
+ },
+ },
+ // bi-学习路径首页
+ {
+ path: '/studypath/finebi',
+ name: 'studypathbi',
+ component: () => import('@/views/studypath/finebi.vue'),
+ meta: {
+ title: 'BI分析师 - 学习路径 - 帆软学院',
+ active: 'studypath',
+ isMobile: 1,
+ },
+ },
+ // bi-学习路径首页
+ {
+ path: '/studypath/finebiAdmin',
+ name: 'studypathbiAdmin',
+ component: () => import('@/views/studypath/finebiAdmin.vue'),
+ meta: {
+ title: 'FineBI管理员 - 学习路径 - 帆软学院',
+ active: 'studypath',
+ isMobile: 1,
+ },
+ },
+
+ // 简道云-学习路径首页
+ {
+ path: '/studypath/jiandaoyun',
+ name: 'studypath_page_jdy',
+ component: () => import('@/views/studypath/jiandaoyun.vue'),
+ meta: {
+ title: '零代码开发工程师 - 学习路径 - 帆软学院',
+ active: 'studypath',
+ isMobile: 1,
+ },
+ },
+ ],
+ },
+
+ {
+ path: '/class/play/:classid/:videoid',
+ name: 'classPlay',
+ component: () => import('@/views/class/play.vue'),
+ meta: {
+ title: '播放课程 - 学习班',
+ active: 'class',
+ },
+ },
+
+ {
+ path: '/live/play/:liveid',
+ name: 'live_play',
+ component: () => import('@/views/live/live_play.vue'),
+ meta: {
+ title: '进入直播 - 直播',
+ active: 'live',
+ isMobile: 1,
+ },
+ },
+
+ // 404
+ {
+ path: '/:catchAll(.*)',
+ name: '请求错误',
+ component: () => import('@/components/404.vue'),
+ },
+];
+
+const router = createRouter({
+ history: createWebHistory(),
+ routes,
+ linkActiveClass: 'active',
+ linkExactActiveClass: 'active',
+ scrollBehavior() {
+ return { top: 0 };
+ },
+});
+
+// 通过导航守卫 判断并刷新token
+let accessToken = store.getters.get_token;
+let expires = getExpiresTime();
+let getdate = parseInt(new Date().getTime() / 1000);
+
+router.beforeEach((to, from, next) => {
+ // const { title } = to.meta;
+ // document.title = getPageTitle(title);
+
+ const get_ticket = to.query.ticket || 0;
+ const get_type = to.query.type ? to.query.type : '0';
+
+ // ticket空执行删除
+ const is_ticket_null = new URL(window.location);
+ if(is_ticket_null.searchParams.has("ticket")){
+ if(get_ticket===0){
+ console.log('ticket空');
+ window.location.replace(process.env.VUE_APP_ID_URL+'/login/token/logout?referrer='+encodeURIComponent(process.env.VUE_APP_EDU_URL));
+ }
+ }
+
+ // fineClubSDK接入
+ let app = 'edu';
+ let isDev = process.env.VUE_APP_ENV == 'dist' ? false : true;
+ const isLogin = getUid() || 0;
+ function getLoginUid() {
+ return getUid() || 0;
+ }
+ window.fineClub.config({ app, getLoginUid, debug: isDev, dev: isDev });
+ // 监听登录
+ function callback(data){
+ console.log('callback_data',data);
+ if(!get_ticket && data.uid > 0 ){
+ console.log('跳转到通行证登录',isLogin);
+ window.location.replace(process.env.VUE_APP_ID_URL+'/login/signin/?app=edu&protocol=cas&referrer='+encodeURIComponent(window.location.href));
+ }
+ // else{
+ // if(isLogin > 1 && process.env.VUE_APP_ENV != 'development'){
+ // console.log('callback','del_token');
+ // console.log('isLogin',isLogin);
+ // store.commit('del_token');
+ // setTimeout(function() {
+ // window.location.replace(process.env.VUE_APP_EDU_URL+to.path);
+ // }, 250);
+ // }
+ // }
+ }
+ window.fineClub.onLoginChange(callback);
+
+
+ if (to.meta.title) {
+ document.title = to.meta.title;
+ }
+
+ // 如果有token和过期时间,然后快过期了执行刷新token
+ if (!get_ticket && accessToken && expires && expires - getdate < 60 * 2) {
+ refreshToken().then((res) => {
+ if (res.code === 200 && res.message != -1) {
+ store.commit('set_token', res.data);
+ } else {
+ // 如果刷新失败,清空所有登录信息
+ console.log('router刷新token', 'del_token');
+ store.commit('del_token');
+ }
+ });
+ // 刷新完毕后,延时进度页面
+ setTimeout(function () {
+ next();
+ }, 500);
+ } else if (get_ticket) {
+ casLogin(get_ticket).then((res) => {
+ if (res.code === 200 && res.status != -1) {
+ console.log('casLogin', res);
+ store.commit('set_token', res.data);
+ setTimeout(function () {
+ window.location.replace(process.env.VUE_APP_EDU_URL + to.path);
+ // parent.location.reload();
+ // let jumpUrl = delUrlParams(location.href,['ticket','sid']);
+ // console.log('jumpUrl',jumpUrl);
+ // parent.window.location.replace(jumpUrl);
+ }, 250);
+ } else {
+ next();
+ }
+ });
+
+ } else if (get_type === 'logout') {
+ console.log('logout', 'del_token');
+ store.commit('del_token');
+ setTimeout(function () {
+ let jumpUrl = delUrlParams(location.href,['type']);
+ window.location.replace(jumpUrl);
+ // next();
+ }, 500);
+ } else {
+ next();
+ }
+});
+
+export default router;
diff --git a/src/router-refresh-cas.js b/src/router-refresh-cas.js
new file mode 100644
index 0000000..e28ecf5
--- /dev/null
+++ b/src/router-refresh-cas.js
@@ -0,0 +1,419 @@
+import { createRouter, createWebHistory } from 'vue-router';
+import Layout from '@/layout/index.vue';
+import store from '@/store';
+import { refreshToken, casLogin } from '@/api/auth';
+import '@/utils/fineClubSDK';
+import { getUid, getExpiresTime } from '@/utils/cookie';
+import { delUrlParams } from '@/utils/urlQuery';
+
+const routes = [
+ {
+ path: '/',
+ name: 'index',
+ component: Layout,
+ children: [
+ {
+ path: '/',
+ name: 'index',
+ component: () => import('@/views/index.vue'),
+ meta: {
+ title: '帆软学院-培养企业亟需的数据人才',
+ isMobile: 1,
+ },
+ },
+
+ {
+ path: '/cityclass',
+ name: 'cityclass',
+ component: () => import('@/views/cityclass.vue'),
+ meta: {
+ title: '城市课堂 - 帆软学院',
+ active: 'cityclass',
+ },
+ },
+
+ /**
+ * 视频课
+ */
+ {
+ path: '/video',
+ name: 'videoindex',
+ component: () => import('@/views/video/indexVideo.vue'),
+ meta: {
+ title: '视频课 - 帆软学院',
+ isMobile: 1,
+ },
+ },
+ {
+ path: '/video/:courseid',
+ name: 'video_course',
+ component: () => import('@/views/video/video_course.vue'),
+ meta: {
+ title: '视频课 - 帆软学院',
+ active: 'video',
+ isMobile: 1,
+ },
+ },
+ {
+ path: '/video/play/:playid',
+ name: 'video_course_play',
+ component: () => import('@/views/video/play.vue'),
+ meta: {
+ title: '播放课程 - 视频课',
+ active: 'video',
+ isMobile: 1,
+ },
+ },
+ /**
+ * 班级
+ */
+ {
+ path: '/class',
+ name: 'StudyClass',
+ component: () => import('@/views/class/indexClass.vue'),
+ meta: {
+ title: '学习班 - 帆软学院',
+ },
+ },
+
+ /**
+ * 进入班级教室
+ */
+ {
+ path: '/class/:classid',
+ name: 'layoutClass',
+ component: () => import('@/views/class/class.vue'),
+ meta: {
+ title: '课程章节 - 学习班',
+ active: 'class',
+ },
+ children: [
+ {
+ path: '/class/:classid',
+ name: 'class_lesson',
+ component: () => import('@/views/class/class_lesson.vue'),
+ meta: {
+ title: '课程章节 - 学习班',
+ active: 'class',
+ tab: 'class_lesson',
+ },
+ },
+ {
+ path: '/class/homework/:classid',
+ name: 'class_homework',
+ component: () => import('@/views/class/class_homework.vue'),
+ meta: {
+ title: '我的作业 - 学习班',
+ active: 'class',
+ },
+ },
+ {
+ path: '/class/forum/:classid',
+ name: 'class_forum',
+ component: () => import('@/views/class/class_forum.vue'),
+ meta: {
+ title: '班级论坛 - 学习班',
+ active: 'class',
+ tab: 'class_forum',
+ },
+ },
+ {
+ path: '/class/forum/:classid/:tid',
+ name: 'class_forum_thread',
+ component: () => import('@/views/class/class_forum_thread.vue'),
+ meta: {
+ title: '班级论坛 - 学习班',
+ active: 'class',
+ tab: 'class_forum',
+ },
+ },
+ ],
+ },
+ /**
+ * 老师后台管理
+ */
+ {
+ path: '/class/admin/:classid',
+ name: 'adminLayoutClass',
+ component: () => import('@/views/class/admin/index_admin_class.vue'),
+ meta: {
+ title: '学生管理 - 学习班',
+ active: 'class',
+ },
+ children: [
+ {
+ path: '/class/admin/student/:classid',
+ name: 'student_admin_class',
+ component: () =>
+ import('@/views/class/admin/student_admin_class.vue'),
+ meta: {
+ title: '学生管理 - 学习班',
+ active: 'class',
+ },
+ },
+ {
+ path: '/class/admin/homework/:classid',
+ name: 'homework_admin_class',
+ component: () =>
+ import('@/views/class/admin/homework_admin_class.vue'),
+ meta: {
+ title: '批改作业 - 学习班',
+ active: 'class',
+ },
+ },
+ {
+ path: '/class/admin/schedule/:classid',
+ name: 'schedule_admin_class',
+ component: () =>
+ import('@/views/class/admin/schedule_admin_class.vue'),
+ meta: {
+ title: '教学进度管理 - 学习班',
+ active: 'class',
+ },
+ },
+ {
+ path: '/class/admin/notice/:classid',
+ name: 'notice_admin_class',
+ component: () =>
+ import('@/views/class/admin/notice_admin_class.vue'),
+ meta: {
+ title: '公告栏管理 - 学习班',
+ active: 'class',
+ },
+ },
+ ],
+ },
+
+ /**
+ * 直播
+ */
+ {
+ path: '/live',
+ name: 'live',
+ component: () => import('@/views/live/live.vue'),
+ meta: {
+ title: '直播 - 帆软学院',
+ },
+ },
+
+ {
+ path: '/live/:liveid',
+ name: 'live_view',
+ component: () => import('@/views/live/live_view.vue'),
+ meta: {
+ title: '直播 - 帆软学院',
+ active: 'live',
+ isMobile: 1,
+ },
+ },
+ // 资源导航
+ {
+ path: '/more',
+ name: 'more',
+ component: () => import('@/views/more.vue'),
+ meta: {
+ title: '资源导航 - 帆软学院',
+ active: 'more',
+ },
+ },
+
+ // 新手入门-地图 finereport
+ {
+ path: '/guide/finereport',
+ name: 'guide_finereport',
+ component: () => import('@/views/video/guide/finereport.vue'),
+ meta: {
+ title: 'FineReport入门学习路径 - 帆软学院',
+ active: 'studypath',
+ },
+ },
+
+ // 新手入门-地图 finebi
+ {
+ path: '/guide/finebi',
+ name: 'guide_finebi',
+ component: () => import('@/views/video/guide/finebi.vue'),
+ meta: {
+ title: 'FineBI入门学习路径 - 帆软学院',
+ active: 'studypath',
+ },
+ },
+
+ // 新手入门-地图 jiandaoyun
+ {
+ path: '/guide/jiandaoyun',
+ name: 'guide_jiandaoyun',
+ component: () => import('@/views/video/guide/jiandaoyun.vue'),
+ meta: {
+ title: '简道云入门学习路径 - 帆软学院',
+ active: 'studypath',
+ },
+ },
+
+ // fr-学习路径首页
+ {
+ path: '/studypath/finereport',
+ name: 'studypathfr',
+ component: () => import('@/views/studypath/finereport.vue'),
+ meta: {
+ title: '报表开发工程师 - 学习路径 - 帆软学院',
+ active: 'studypath',
+ isMobile: 1,
+ },
+ },
+ // bi-学习路径首页
+ {
+ path: '/studypath/finebi',
+ name: 'studypathbi',
+ component: () => import('@/views/studypath/finebi.vue'),
+ meta: {
+ title: 'BI分析师 - 学习路径 - 帆软学院',
+ active: 'studypath',
+ isMobile: 1,
+ },
+ },
+ // bi-学习路径首页
+ {
+ path: '/studypath/finebiAdmin',
+ name: 'studypathbiAdmin',
+ component: () => import('@/views/studypath/finebiAdmin.vue'),
+ meta: {
+ title: 'FineBI管理员 - 学习路径 - 帆软学院',
+ active: 'studypath',
+ isMobile: 1,
+ },
+ },
+
+ // 简道云-学习路径首页
+ {
+ path: '/studypath/jiandaoyun',
+ name: 'studypath_page_jdy',
+ component: () => import('@/views/studypath/jiandaoyun.vue'),
+ meta: {
+ title: '零代码开发工程师 - 学习路径 - 帆软学院',
+ active: 'studypath',
+ isMobile: 1,
+ },
+ },
+ ],
+ },
+
+ {
+ path: '/class/play/:classid/:videoid',
+ name: 'classPlay',
+ component: () => import('@/views/class/play.vue'),
+ meta: {
+ title: '播放课程 - 学习班',
+ active: 'class',
+ },
+ },
+
+ {
+ path: '/live/play/:liveid',
+ name: 'live_play',
+ component: () => import('@/views/live/live_play.vue'),
+ meta: {
+ title: '进入直播 - 直播',
+ active: 'live',
+ isMobile: 1,
+ },
+ },
+
+ // 404
+ {
+ path: '/:catchAll(.*)',
+ name: '请求错误',
+ component: () => import('@/components/404.vue'),
+ },
+];
+
+const router = createRouter({
+ history: createWebHistory(),
+ routes,
+ linkActiveClass: 'active',
+ linkExactActiveClass: 'active',
+ scrollBehavior() {
+ return { top: 0 };
+ },
+});
+
+// 通过导航守卫 判断并刷新token
+let accessToken = store.getters.get_token;
+let expires = getExpiresTime();
+let getdate = parseInt(new Date().getTime() / 1000);
+
+router.beforeEach((to, from, next) => {
+ // const { title } = to.meta;
+ // document.title = getPageTitle(title);
+
+ const get_ticket = to.query.ticket || 0;
+ const get_type = to.query.type ? to.query.type : '0';
+
+ // ticket空执行删除
+ const is_ticket_null = new URL(window.location);
+ if(is_ticket_null.searchParams.has("ticket")){
+ if(get_ticket===0){
+ console.log('ticket空');
+ parent.window.location.replace(process.env.VUE_APP_ID_URL+'/login/token/logout?referrer='+encodeURIComponent(process.env.VUE_APP_EDU_URL));
+ }
+ }
+
+ // fineClubSDK接入
+ let app = 'edu';
+ let isDev = process.env.VUE_APP_ENV == 'dist' ? false : true;
+ function getLoginUid() {
+ return getUid() || 0;
+ }
+ window.fineClub.config({ app, getLoginUid, debug: isDev, dev: isDev });
+ window.fineClub.autoReloadOnLoginChange({ loginUrl: process.env.VUE_APP_ID_URL + '/login/signin/?app=edu&protocol=cas&referrer=' + encodeURIComponent(window.location.href) });
+
+ if (to.meta.title) {
+ document.title = to.meta.title;
+ }
+
+ // 如果有token和过期时间,然后快过期了执行刷新token
+ if (!get_ticket && accessToken && expires && expires - getdate < 60 * 2) {
+ refreshToken().then((res) => {
+ if (res.code === 200 && res.message != -1) {
+ store.commit('set_token', res.data);
+ } else {
+ // 如果刷新失败,清空所有登录信息
+ console.log('router刷新token', 'del_token');
+ store.commit('del_token');
+ }
+ });
+ // 刷新完毕后,延时进度页面
+ setTimeout(function () {
+ next();
+ }, 500);
+ } else if (get_ticket) {
+ casLogin(get_ticket).then((res) => {
+ if (res.code === 200 && res.status != -1) {
+ console.log('casLogin', res);
+ store.commit('set_token', res.data);
+ setTimeout(function () {
+ // parent.window.location.replace(process.env.VUE_APP_EDU_URL + to.path);
+ // parent.location.reload();
+ let jumpUrl = delUrlParams(location.href,['ticket','sid']);
+ console.log('jumpUrl',jumpUrl);
+ parent.window.location.replace(jumpUrl);
+ }, 250);
+ } else {
+ next();
+ }
+ });
+
+ } else if (get_type === 'logout') {
+ console.log('logout', 'del_token');
+ store.commit('del_token');
+ setTimeout(function () {
+ let jumpUrl = delUrlParams(location.href,['type']);
+ window.location.replace(jumpUrl);
+ // next();
+ }, 500);
+ } else {
+ next();
+ }
+});
+
+export default router;
diff --git a/src/router.js b/src/router.js
index d821980..4a263a5 100644
--- a/src/router.js
+++ b/src/router.js
@@ -349,6 +349,15 @@ router.beforeEach((to, from, next) => {
const get_ticket = to.query.ticket || 0;
const get_type = to.query.type ? to.query.type : '0';
+ // ticket空执行删除
+ const is_ticket_null = new URL(window.location);
+ if(is_ticket_null.searchParams.has("ticket")){
+ if(get_ticket===0 || get_ticket=='null'){
+ console.log('ticket空');
+ parent.window.location.replace(process.env.VUE_APP_ID_URL+'/login/token/logout?referrer='+encodeURIComponent(process.env.VUE_APP_EDU_URL));
+ }
+ }
+
// fineClubSDK接入
let app = 'edu';
let isDev = process.env.VUE_APP_ENV == 'dist' ? false : true;
diff --git a/src/views/class/indexClass.vue b/src/views/class/indexClass.vue
index 4936fc5..de99da6 100644
--- a/src/views/class/indexClass.vue
+++ b/src/views/class/indexClass.vue
@@ -18,7 +18,7 @@
diff --git a/src/views/class/play-old.vue b/src/views/class/play-old.vue
index a75014d..3679f17 100644
--- a/src/views/class/play-old.vue
+++ b/src/views/class/play-old.vue
@@ -3,7 +3,7 @@
无权限查看,当前页面需要 登录
+ :href="com_login_url" class="col008">登录
diff --git a/src/views/class/play.vue b/src/views/class/play.vue
index 6cbc408..5dd4ddd 100644
--- a/src/views/class/play.vue
+++ b/src/views/class/play.vue
@@ -3,7 +3,7 @@
无权限查看,当前页面需要 登录
+ :href="com_login_url" class="col008">登录
@@ -148,7 +148,7 @@
timerPrss: null,
showAutoBox: false,
is_duration: true,
- playThisId:route.params.playid
+ playThisId:route.params.videoid
})
// 获取视频 待删 MARKET-4168
@@ -191,6 +191,7 @@
// 列表点击切换视频
const getvideo_click = async (id, replay=0) => {
+
state.playThisId = id;
state.is_duration = false;
clearInterval(state.timerTxt);
@@ -199,7 +200,7 @@
state.ckPlayer.videoClear();
state.ckPlayer = null;
document.getElementById("VideoPlay").innerHTML = "";
-
+
setTimeout(function () {
getvideoDom(id, replay);
getNextId(id);
@@ -215,7 +216,7 @@
* @replay 1=重播
* @resOne 1=第一次进入页面播放
**/
- const getvideoDom = async (id, replay=0, resOne=0) => {
+ const getvideoDom = async (id, replay=0, resOne=0) => {
// 获取视频
const res = await getVideo(classid, id);
@@ -224,7 +225,7 @@
state.video = res.data;
state.play_title = res.data.title;
state.videoObject.video = res.data.videourl;
- state.arrVideo.push(res.data);
+ state.arrVideo.push(res.data);
if (res.data.playtime > 0) {
state.videoObject.seek = res.data.playtime;
@@ -326,7 +327,7 @@
// 重置新id
state.logid = res.data.logid;
state.videoid = res.data.id;
- console.log('videoid',state.videoid);
+ console.log('log_videoid',state.videoid);
// 修改路由
let winState = { url: id };
diff --git a/src/views/index.vue b/src/views/index.vue
index 4aaf9fc..634cf57 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -194,6 +194,9 @@
+
+
+
diff --git a/src/views/live/live_play.vue b/src/views/live/live_play.vue
index cd2748c..db89f32 100644
--- a/src/views/live/live_play.vue
+++ b/src/views/live/live_play.vue
@@ -5,7 +5,7 @@
diff --git a/src/views/live/live_view.vue b/src/views/live/live_view.vue
index 0e3940e..dbac116 100644
--- a/src/views/live/live_view.vue
+++ b/src/views/live/live_view.vue
@@ -112,7 +112,7 @@
diff --git a/src/views/video/guide/jiandaoyun.vue b/src/views/video/guide/jiandaoyun.vue
index 3a092de..c8d7a22 100644
--- a/src/views/video/guide/jiandaoyun.vue
+++ b/src/views/video/guide/jiandaoyun.vue
@@ -3,7 +3,7 @@
diff --git a/src/views/video/play.vue b/src/views/video/play.vue
index 0a8db1f..d8c6f56 100644
--- a/src/views/video/play.vue
+++ b/src/views/video/play.vue
@@ -18,8 +18,7 @@