Browse Source

Merge pull request 'develop' (#1) from develop into master

Reviewed-on: #1
master 2.0
myxiaowei 2 years ago
parent
commit
2de7ecb171
  1. 4
      .env.development
  2. 4
      src/api/teacher.js
  3. 13
      src/components/Header.vue
  4. 35
      src/components/TeacherApply/TeacherApplyModal.vue
  5. 2
      src/components/msgLogin.vue
  6. 1
      src/main.js
  7. 5
      src/mixins/mixins.js
  8. 439
      src/router-jump-cas.js
  9. 419
      src/router-refresh-cas.js
  10. 9
      src/router.js
  11. 2
      src/views/class/indexClass.vue
  12. 2
      src/views/class/play-old.vue
  13. 7
      src/views/class/play.vue
  14. 3
      src/views/index.vue
  15. 2
      src/views/live/live_play.vue
  16. 4
      src/views/live/live_view.vue
  17. 4
      src/views/play.vue
  18. 2
      src/views/video/guide/finebi.vue
  19. 2
      src/views/video/guide/finereport.vue
  20. 2
      src/views/video/guide/jiandaoyun.vue
  21. 38
      src/views/video/play.vue
  22. 3
      src/views/video/video_course.vue
  23. 8
      workspace.code-workspace

4
.env.development

@ -2,13 +2,13 @@ VUE_APP_ENV = 'development'
VUE_APP_NAME = 学院 VUE_APP_NAME = 学院
VUE_APP_API_URL = https://testapi VUE_APP_API_URL = https://testapi
#VUE_APP_API_URL = https://api.shequ.fanruan.com #VUE_APP_API_URL = https://api.shequ.fanruan.com
NEW_VUE_APP_API_URL = http://47.103.147.140:9094 NEW_VUE_APP_API_URL = http://139.196.30.6:9094
VUE_APP_EDU_URL = http://localhost:8084 VUE_APP_EDU_URL = http://localhost:8084
VUE_APP_TOKEN_URL = http://localhost VUE_APP_TOKEN_URL = http://localhost
VUE_APP_SHEQU_URL = https://frbbs VUE_APP_SHEQU_URL = https://frbbs
VUE_APP_ID_URL = https://id VUE_APP_ID_URL = https://id
#VUE_APP_ID_URL = https://passport.fanruan.com #VUE_APP_ID_URL = https://passport.fanruan.com
#VUE_APP_CIDAPI_URL = https://cid.fanruan.com/api #VUE_APP_CIDAPI_URL = https://cid.fanruan.com/api
VUE_APP_CIDAPI_URL = https://test-cid/api VUE_APP_CIDAPI_URL = https://cid/api
VUE_APP_PASS_URL = http://localhost:8080 VUE_APP_PASS_URL = http://localhost:8080
VUE_APP_CERT_URL = https://admin.shequ.fanruan.com VUE_APP_CERT_URL = https://admin.shequ.fanruan.com

4
src/api/teacher.js

@ -19,3 +19,7 @@ export function addTeacher(params) {
export function editTeacher(id, params) { export function editTeacher(id, params) {
return requestPut(`/api/lecturer/${id}`,params); return requestPut(`/api/lecturer/${id}`,params);
} }
export function judgeIsTeacher(uid) {
return requestGet(`/api/lecturer/check/${uid}`);
}

13
src/components/Header.vue

@ -123,7 +123,7 @@
</el-dropdown-item> </el-dropdown-item>
<el-divider></el-divider> <el-divider></el-divider>
<el-dropdown> <el-dropdown>
<teacherApplyModal /> <teacherApplyModal :uid="uid"/>
</el-dropdown> </el-dropdown>
<el-divider></el-divider> <el-divider></el-divider>
<el-dropdown-item v-for="(item, i) in avatarMenu.adminMenu" :key="i" :icon="item.icon"> <el-dropdown-item v-for="(item, i) in avatarMenu.adminMenu" :key="i" :icon="item.icon">
@ -139,9 +139,9 @@
</template> </template>
</el-dropdown> </el-dropdown>
<div v-else class="loginReg flex-1"> <div v-else class="loginReg flex-1">
<a class="loginbtn" :href="com_id_url+'/login/signin/'+'?referrer='+wwwUrl" <a class="loginbtn" :href="com_id_url+'/login/signin/'+'?app=edu&protocol=cas&referrer='+wwwUrl"
v-if="com_node_env==='dist'">登录</a> v-if="com_node_env==='dist'">登录</a>
<a class="loginbtn" :href="com_id_url+'/signin/'+'?referrer='+wwwUrl" v-else>登录</a> <a class="loginbtn" :href="com_id_url+'/signin/'+'?app=edu&protocol=cas&referrer='+wwwUrl" v-else>登录</a>
</div> </div>
</nav> </nav>
@ -149,7 +149,7 @@
</header> </header>
<div class="edu-nav-box"> <div class="edu-nav-box" v-if="isPc">
<div class="mainbox"> <div class="mainbox">
<div class="edu-head"> <div class="edu-head">
<router-link class="logo" to="/"><img src="@/assets/logo.png" /></router-link> <router-link class="logo" to="/"><img src="@/assets/logo.png" /></router-link>
@ -168,7 +168,7 @@
</div> </div>
<!-- 移动端 --> <!-- 移动端 -->
<div class="edu-nav-box-m dn"> <div class="edu-nav-box-m dn" v-else>
<!-- search --> <!-- search -->
<div class="ss-main-box dn" :class="{showss:ssOpen}"> <div class="ss-main-box dn" :class="{showss:ssOpen}">
@ -236,7 +236,7 @@
</el-dropdown-item> </el-dropdown-item>
<el-divider></el-divider> <el-divider></el-divider>
<el-dropdown> <el-dropdown>
<teacherApplyModal /> <teacherApplyModal :uid="uid"/>
</el-dropdown> </el-dropdown>
<el-divider></el-divider> <el-divider></el-divider>
<el-dropdown-item v-for="(item, i) in avatarMenu.adminMenu" :key="i" :icon="item.icon"> <el-dropdown-item v-for="(item, i) in avatarMenu.adminMenu" :key="i" :icon="item.icon">
@ -359,6 +359,7 @@
setup() { setup() {
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const state = reactive({ const state = reactive({
isPc: document.body.clientWidth > 1200,
allMenu: [], allMenu: [],
leftMenu: [], leftMenu: [],
rightMenu: [], rightMenu: [],

35
src/components/TeacherApply/TeacherApplyModal.vue

@ -1,5 +1,5 @@
<template> <template>
<a :href="com_edu_url + '/v2'" class="til f16 fw600" v-if="form.status === 1" target="_blank"> <a :href="com_edu_url + '/v2'" class="til f16 fw600" v-if="isTeacher" target="_blank">
<div class="item-nav apply_trigger_btn"> <div class="item-nav apply_trigger_btn">
<i class="iconfont icon-icon_icon-37" /> <i class="iconfont icon-icon_icon-37" />
讲师工作台 讲师工作台
@ -68,13 +68,17 @@
import {defineComponent, reactive, ref} from 'vue' import {defineComponent, reactive, ref} from 'vue'
import teacherApplyUpload from './Upload/TeacherApplyUpload'; import teacherApplyUpload from './Upload/TeacherApplyUpload';
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { addTeacher, getTeacherInfo, editTeacher, getUserInfo } from "../../api/teacher" import { addTeacher, getTeacherInfo, editTeacher, judgeIsTeacher } from "../../api/teacher"
export default defineComponent({ export default defineComponent({
name: 'TeacherApplyModal', name: 'TeacherApplyModal',
props:{
uid:undefined
},
components:{ components:{
teacherApplyUpload teacherApplyUpload
}, },
setup() { setup(props) {
const isTeacher = ref(false);
const dialogVisible = ref(false); const dialogVisible = ref(false);
const qrDialogVisible = ref(false); const qrDialogVisible = ref(false);
const submitLoading = ref(false); const submitLoading = ref(false);
@ -87,29 +91,31 @@ export default defineComponent({
introduction: '', introduction: '',
avatar:'', avatar:'',
}) })
const showModal = () => { const judgeIfTeacher = async () => {
dialogVisible.value = true const judgeRes = await judgeIsTeacher(props.uid)
if (judgeRes.code === 200){
isTeacher.value = judgeRes.data;
} }
// }
judgeIfTeacher();
const getInfo = async () => { const getInfo = async () => {
const userInfoRes = await getUserInfo(); console.log('获取用户资料');
const res = await getTeacherInfo(); const res = await getTeacherInfo();
if (userInfoRes.code === 200 && userInfoRes.data){
const {mobile} = userInfoRes.data;
form.phone = mobile;
}
if (res.code === 200 && res.data){ 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.name = name;
form.avatar = avatar; form.avatar = avatar;
form.introduction = introduction; form.introduction = introduction;
form.teacherId = id; form.teacherId = id;
form.status=res.data.approvalState; form.status=res.data.approvalState;
} }
console.log('讲师资料是');
console.log(res);
} }
const showModal = () => {
getInfo(); getInfo();
dialogVisible.value = true
}
//
const rules = reactive({ const rules = reactive({
name: [ name: [
{ required: true, message: '请输入讲师姓名', trigger: 'blur' }, { required: true, message: '请输入讲师姓名', trigger: 'blur' },
@ -168,6 +174,7 @@ export default defineComponent({
}) })
} }
return { return {
isTeacher,
dialogVisible, dialogVisible,
form, form,
ruleFormRef, ruleFormRef,

2
src/components/msgLogin.vue

@ -2,7 +2,7 @@
<div v-if="!com_user_token" class="msg-box"> <div v-if="!com_user_token" class="msg-box">
<el-alert type="warning" center show-icon close-text=" " style="height: 80px"> <el-alert type="warning" center show-icon close-text=" " style="height: 80px">
<div class="f16" style="padding: 6px 0 12px"> <div class="f16" style="padding: 6px 0 12px">
无权限查看,当前页面需要 <a :href="com_id_url+'/signin/'+'?referrer='+com_edu_url+$route.path" >登录</a> 无权限查看,当前页面需要 <a :href="com_login_url" >登录</a>
</div> </div>
</el-alert> </el-alert>
</div> </div>

1
src/main.js

@ -4,7 +4,6 @@ import 'dayjs/locale/zh-cn'
import locale from 'element-plus/lib/locale/lang/zh-cn' import locale from 'element-plus/lib/locale/lang/zh-cn'
import 'element-plus/lib/theme-chalk/index.css'; import 'element-plus/lib/theme-chalk/index.css';
import './assets/icons' import './assets/icons'
//import 'element-plus/dist/index.css'
import App from './App.vue'; import App from './App.vue';
import router from './router'; import router from './router';
import store from './store'; import store from './store';

5
src/mixins/mixins.js

@ -7,6 +7,8 @@
*/ */
//import { getToken } from "@/utils/cookie"; //import { getToken } from "@/utils/cookie";
import store from '@/store' import store from '@/store'
// import { useRoute } from 'vue-router'
export const mixins = { export const mixins = {
data() { data() {
return { return {
@ -17,7 +19,8 @@ export const mixins = {
com_node_env: process.env.VUE_APP_ENV || 'production', com_node_env: process.env.VUE_APP_ENV || 'production',
com_pass_url: process.env.VUE_APP_PASS_URL || 'https://fanruanclub.com', 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_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() { created() {

439
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;

419
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;

9
src/router.js

@ -349,6 +349,15 @@ router.beforeEach((to, from, next) => {
const get_ticket = to.query.ticket || 0; const get_ticket = to.query.ticket || 0;
const get_type = to.query.type ? to.query.type : '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接入 // fineClubSDK接入
let app = 'edu'; let app = 'edu';
let isDev = process.env.VUE_APP_ENV == 'dist' ? false : true; let isDev = process.env.VUE_APP_ENV == 'dist' ? false : true;

2
src/views/class/indexClass.vue

@ -18,7 +18,7 @@
<div v-if="!com_user_token" style=" background-color: #fff; border-radius: 8px"> <div v-if="!com_user_token" style=" background-color: #fff; border-radius: 8px">
<el-empty :image-size="150" description=" "> <el-empty :image-size="150" description=" ">
<div class="col617">登录后才能查看您参加的学习班哦 <div class="col617">登录后才能查看您参加的学习班哦
<a :href="com_id_url+'/signin/'+'?referrer='+com_edu_url+$route.path" class="col008">马上登录</a> <a :href="com_login_url" class="col008">马上登录</a>
</div> </div>
</el-empty> </el-empty>
</div> </div>

2
src/views/class/play-old.vue

@ -3,7 +3,7 @@
<appHeader /> <appHeader />
<div v-if="!com_user_token"> <div v-if="!com_user_token">
<el-empty :image-size="200" description=" ">无权限查看当前页面需要 <a <el-empty :image-size="200" description=" ">无权限查看当前页面需要 <a
:href="com_id_url+'/signin/'+'?referrer='+com_edu_url+$route.path" class="col008">登录</a></el-empty> :href="com_login_url" class="col008">登录</a></el-empty>
</div> </div>
<div v-if="isAuth"> <div v-if="isAuth">
<div class="main"> <div class="main">

7
src/views/class/play.vue

@ -3,7 +3,7 @@
<appHeader /> <appHeader />
<div v-if="!com_user_token"> <div v-if="!com_user_token">
<el-empty :image-size="200" description=" ">无权限查看当前页面需要 <a <el-empty :image-size="200" description=" ">无权限查看当前页面需要 <a
:href="com_id_url+'/signin/'+'?referrer='+com_edu_url+$route.path" class="col008">登录</a></el-empty> :href="com_login_url" class="col008">登录</a></el-empty>
</div> </div>
<div v-if="isAuth"> <div v-if="isAuth">
<div class="main"> <div class="main">
@ -148,7 +148,7 @@
timerPrss: null, timerPrss: null,
showAutoBox: false, showAutoBox: false,
is_duration: true, is_duration: true,
playThisId:route.params.playid playThisId:route.params.videoid
}) })
// MARKET-4168 // MARKET-4168
@ -191,6 +191,7 @@
// //
const getvideo_click = async (id, replay=0) => { const getvideo_click = async (id, replay=0) => {
state.playThisId = id; state.playThisId = id;
state.is_duration = false; state.is_duration = false;
clearInterval(state.timerTxt); clearInterval(state.timerTxt);
@ -326,7 +327,7 @@
// id // id
state.logid = res.data.logid; state.logid = res.data.logid;
state.videoid = res.data.id; state.videoid = res.data.id;
console.log('videoid',state.videoid); console.log('log_videoid',state.videoid);
// //
let winState = { url: id }; let winState = { url: id };

3
src/views/index.vue

@ -194,6 +194,9 @@
</div> </div>
</router-link> </router-link>
</li> </li>
<div v-if="[2].includes(item.list.length) " style="width: 276px;"></div>
<div v-if="[2].includes(item.list.length) " style="width: 276px;"></div>
<div v-if="[3].includes(item.list.length) " style="width: 276px;"></div>
</div> </div>
</div> </div>

2
src/views/live/live_play.vue

@ -5,7 +5,7 @@
<div v-if="!com_user_token"> <div v-if="!com_user_token">
<el-empty :image-size="200" description=" ">无权限查看当前页面需要登录</el-empty> <el-empty :image-size="200" description=" ">无权限查看当前页面需要登录</el-empty>
<div style="text-align: center"> <div style="text-align: center">
<a :href="com_id_url+'/signin/'+'?isfridapp=yes&referrer='+com_edu_url+$route.path" class="el-btn medium ff18">马上登录</a> <a :href="com_login_url" class="el-btn medium ff18">马上登录</a>
</div> </div>
</div> </div>

4
src/views/live/live_view.vue

@ -112,7 +112,7 @@
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<div v-if="mycredit.money < basic.credit"> <div v-if="basic.credit > 0 && mycredit.money < basic.credit">
<div class="txt-c colf26 f14" style="padding-bottom: 16px;" v-if="basic.credit>0"> <div class="txt-c colf26 f14" style="padding-bottom: 16px;" v-if="basic.credit>0">
F币 不足<span>{{basic.credit}}</span> F币 不足<span>{{basic.credit}}</span>
</div> </div>
@ -133,7 +133,7 @@
<el-popover placement="top" :width="300" trigger="click"> <el-popover placement="top" :width="300" trigger="click">
<p style="padding: 12px 0 16px; text-align: center;" class="f14">您还未登录哦~~登录后再报名吧</p> <p style="padding: 12px 0 16px; text-align: center;" class="f14">您还未登录哦~~登录后再报名吧</p>
<div style="text-align: center; padding: 14px 0;"> <div style="text-align: center; padding: 14px 0;">
<a :href="com_id_url+'/signin/'+'?isfridapp=yes&referrer='+com_edu_url+$route.path" <a :href="com_login_url"
class="el-btn medium">立即登录</a> class="el-btn medium">立即登录</a>
</div> </div>
<template #reference> <template #reference>

4
src/views/play.vue

@ -16,8 +16,8 @@
</div> </div>
<div class="nullData flex-4" v-if="!com_user_token"> <div class="nullData flex-4" v-if="!com_user_token">
<span>抱歉本站注册会员可以看课程</span> <span>抱歉本站注册用户可以看课程</span>
<a :href="com_id_url+'/signin/'+'?referrer='+com_edu_url+$route.path" class="el-btn medium ff18">会员登录</a> <a :href="com_login_url" class="el-btn medium ff18">马上登录</a>
</div> </div>

2
src/views/video/guide/finebi.vue

@ -3,7 +3,7 @@
<el-dialog title="抱歉,当前页面需要登录" model-value="1" width="300px" :show-close="false" :close-on-press-escape="false" <el-dialog title="抱歉,当前页面需要登录" model-value="1" width="300px" :show-close="false" :close-on-press-escape="false"
:close-on-click-modal="false"> :close-on-click-modal="false">
<div class="f16" style="padding: 14px 0 12px"> <div class="f16" style="padding: 14px 0 12px">
<a class="fr-btn big" :href="com_id_url+'/signin/'+'?referrer='+com_edu_url+$route.path">马上登录</a> <a class="fr-btn big" :href="com_login_url">马上登录</a>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>

2
src/views/video/guide/finereport.vue

@ -3,7 +3,7 @@
<el-dialog title="抱歉,当前页面需要登录" model-value="1" width="300px" :show-close="false" :close-on-press-escape="false" <el-dialog title="抱歉,当前页面需要登录" model-value="1" width="300px" :show-close="false" :close-on-press-escape="false"
:close-on-click-modal="false"> :close-on-click-modal="false">
<div class="f16" style="padding: 14px 0 12px"> <div class="f16" style="padding: 14px 0 12px">
<a class="fr-btn big" :href="com_id_url+'/signin/'+'?referrer='+com_edu_url+$route.path">马上登录</a> <a class="fr-btn big" :href="com_login_url">马上登录</a>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>

2
src/views/video/guide/jiandaoyun.vue

@ -3,7 +3,7 @@
<el-dialog title="抱歉,当前页面需要登录" model-value="1" width="300px" :show-close="false" :close-on-press-escape="false" <el-dialog title="抱歉,当前页面需要登录" model-value="1" width="300px" :show-close="false" :close-on-press-escape="false"
:close-on-click-modal="false"> :close-on-click-modal="false">
<div class="f16" style="padding: 14px 0 12px"> <div class="f16" style="padding: 14px 0 12px">
<a class="fr-btn big" :href="com_id_url+'/signin/'+'?referrer='+com_edu_url+$route.path">马上登录</a> <a class="fr-btn big" :href="com_login_url">马上登录</a>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>

38
src/views/video/play.vue

@ -18,8 +18,7 @@
<div class="nullData flex-4" v-if="!com_user_token"> <div class="nullData flex-4" v-if="!com_user_token">
<span>抱歉需登录后观看课程</span> <span>抱歉需登录后观看课程</span>
<a :href="com_id_url+'/signin/?referrer='+com_jump_url" <a :href="com_login_url" class="el-btn medium ff18">马上登录</a>
class="el-btn medium ff18">马上登录</a>
</div> </div>
<div class="autotime" v-show="showAutoBox"> <div class="autotime" v-show="showAutoBox">
@ -138,7 +137,7 @@
showAutoBox: false, showAutoBox: false,
is_duration: true, is_duration: true,
is_scroll: false, is_scroll: false,
playThisId:route.params.playid playThisId: route.params.playid
}) })
@ -178,8 +177,8 @@
const postSourceDeviceLog = async () => { const postSourceDeviceLog = async () => {
let get_from = route.query.from || null; let get_from = route.query.from || null;
const params = { const params = {
source:get_from, source: get_from,
device:isMobileValue() device: isMobileValue()
} }
await sourceDeviceLog(params); await sourceDeviceLog(params);
} }
@ -187,11 +186,15 @@
// //
const postlogData = async (logData) => { const postlogData = async (logData) => {
await classlog(logData); let logParams = {
...logData,
vid: state.videoid
}
await classlog(logParams);
} }
// //
const getvideo_click = async (id, replay=0) => { const getvideo_click = async (id, replay = 0) => {
state.playThisId = id; state.playThisId = id;
state.is_duration = false; state.is_duration = false;
clearInterval(state.timerTxt); clearInterval(state.timerTxt);
@ -227,10 +230,10 @@
* @replay 1=重播 * @replay 1=重播
* @resOne 1=第一次进入页面播放 * @resOne 1=第一次进入页面播放
**/ **/
const getvideoDom = async (id, replay=0, resOne=0) => { const getvideoDom = async (id, replay = 0, resOne = 0) => {
// //
if(resOne === 1){ if (resOne === 1) {
postSourceDeviceLog(); postSourceDeviceLog();
} }
@ -242,6 +245,8 @@
state.play_title = res.data.it618_name; state.play_title = res.data.it618_name;
state.videoObject.video = res.data.it618_videourl; state.videoObject.video = res.data.it618_videourl;
console.log('res.data', res.data);
if (res.data.playtime > 0) { if (res.data.playtime > 0) {
state.videoObject.seek = res.data.playtime; state.videoObject.seek = res.data.playtime;
} }
@ -336,7 +341,7 @@
// //
let get_duration = localStorage.getItem(state.videoid + '_duration_video'); let get_duration = localStorage.getItem(state.videoid + '_duration_video');
if(resOne !=1 && get_duration){ if (resOne != 1 && get_duration) {
let logData = { let logData = {
logid: state.logid, logid: state.logid,
pytime: localStorage.getItem(state.videoid + '_playTime_video'), pytime: localStorage.getItem(state.videoid + '_playTime_video'),
@ -348,7 +353,7 @@
// id // id
state.logid = res.data.logid; state.logid = res.data.logid;
state.videoid = res.data.id; state.videoid = res.data.id;
console.log('videoid',state.videoid); console.log('log_videoid', state.videoid);
// //
let winState = { url: id }; let winState = { url: id };
@ -533,16 +538,18 @@
font-size: 24px; font-size: 24px;
padding-bottom: 20px; padding-bottom: 20px;
} }
.txt_next{
.txt_next {
color: #fff; color: #fff;
font-size: 16px; font-size: 16px;
margin-bottom: 36px; margin-bottom: 36px;
} }
.sel_btn_box{ .sel_btn_box {
width: 310px; width: 310px;
margin: 0 auto; margin: 0 auto;
.btn_sty{
.btn_sty {
width: 46%; width: 46%;
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
@ -552,6 +559,7 @@
border: 1px solid #fff; border: 1px solid #fff;
border-radius: 6px; border-radius: 6px;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
background-color: #0082fc; background-color: #0082fc;
border: 1px solid #0082fc; border: 1px solid #0082fc;
@ -783,7 +791,7 @@
display: block !important; display: block !important;
} }
.autotime{ .autotime {
height: 35vh; height: 35vh;
top: 50px; top: 50px;
} }

3
src/views/video/video_course.vue

@ -104,8 +104,7 @@
<el-popover placement="top" :width="300" trigger="click"> <el-popover placement="top" :width="300" trigger="click">
<p style="padding: 12px 0 16px; text-align: center;" class="f14">您还未登录哦~~登录后再购买吧</p> <p style="padding: 12px 0 16px; text-align: center;" class="f14">您还未登录哦~~登录后再购买吧</p>
<div style="text-align: center; padding: 14px 0;"> <div style="text-align: center; padding: 14px 0;">
<a :href="com_id_url+'/signin/'+'?isfridapp=yes&referrer='+com_edu_url+$route.path" <a :href="com_login_url" class="el-btn medium">立即登录</a>
class="el-btn medium">立即登录</a>
</div> </div>
<template #reference> <template #reference>

8
workspace.code-workspace

@ -1,8 +0,0 @@
{
"folders": [
{
"path": "."
}
],
"settings": {}
}
Loading…
Cancel
Save