|
@@ -6,7 +6,7 @@ import { Notification, MessageBox, Message } from 'element-ui'
|
|
|
import tools from '../common/tools'
|
|
|
Vue.use(Router)
|
|
|
|
|
|
-let bankAdmin = ['/person-center/bank-record','/person-center/my-bank/index','/person-center/my-collect','/person-center/my-wrong','/person-center/my-bank/bank-detail/','/person-center/my-bank/bank-statistics/','/person-center/my-bank/bank-explain-detail/','/bank-exam-continue/','/bank-exam/','/subject/collect-bank/','/bank-exam-explain/','/bank-report/'];
|
|
|
+let bankAdmin = ['/person-center/bank-record','/person-center/my-bank/index','/person-center/free-bank/index','/person-center/my-collect','/person-center/my-wrong','/person-center/my-bank/bank-detail/','/person-center/my-bank/bank-statistics/','/person-center/my-bank/bank-explain-detail/','/person-center/free-bank/bank-detail/','/person-center/free-bank/bank-statistics/','/person-center/free-bank/bank-explain-detail/','/bank-exam-continue/','/bank-exam/','/subject/collect-bank/','/bank-exam-explain/','/bank-report/'];
|
|
|
let canToBank = null;
|
|
|
let courseAdmin = ['/my-course-detail/','/course-exam/']
|
|
|
let canToCourse = null;
|
|
@@ -327,7 +327,7 @@ const router = new Router({
|
|
|
{
|
|
|
path: 'my-bank',
|
|
|
component: resolve => require(['@/pages/person-center/my-bank/index'],resolve),
|
|
|
- name:'我的题库',
|
|
|
+ name:'自购题卷',
|
|
|
children:[
|
|
|
{
|
|
|
path: '/',
|
|
@@ -336,7 +336,7 @@ const router = new Router({
|
|
|
{
|
|
|
path: 'index',
|
|
|
component: resolve => require(['@/pages/person-center/my-bank/index/index'],resolve),
|
|
|
- name: '我的题库',
|
|
|
+ name: '自购题卷',
|
|
|
},
|
|
|
{
|
|
|
path: 'bank-detail/:goodsId',
|
|
@@ -355,6 +355,37 @@ const router = new Router({
|
|
|
},
|
|
|
]
|
|
|
},
|
|
|
+ {
|
|
|
+ path: 'free-bank',
|
|
|
+ component: resolve => require(['@/pages/person-center/free-bank/index'],resolve),
|
|
|
+ name:'赠送题卷',
|
|
|
+ children:[
|
|
|
+ {
|
|
|
+ path: '/',
|
|
|
+ redirect: 'index',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: 'index',
|
|
|
+ component: resolve => require(['@/pages/person-center/free-bank/index/index'],resolve),
|
|
|
+ name: '赠送题卷',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: 'bank-detail/:goodsId',
|
|
|
+ component: resolve => require(['@/pages/person-center/free-bank/bank-detail/index'],resolve),
|
|
|
+ name: '题库详情'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: 'bank-statistics/:goodsId',
|
|
|
+ component: resolve => require(['@/pages/person-center/free-bank/bank-statistics/index'],resolve),
|
|
|
+ name: '做题统计'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: 'bank-explain-detail/:goodsId',
|
|
|
+ component: resolve => require(['@/pages/person-center/free-bank/bank-explain-detail/index'],resolve),
|
|
|
+ name: '详情'
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ },
|
|
|
{
|
|
|
path: 'bank-record',
|
|
|
component: resolve => require(['@/pages/person-center/bank-record/index'],resolve),
|
|
@@ -491,155 +522,155 @@ router.beforeEach((to,from,next) => {
|
|
|
store.dispatch('getUserInfo')
|
|
|
}
|
|
|
|
|
|
- // //题库页面要检测是否需要锁定
|
|
|
- let isBankLock = bankAdmin.some(item => {
|
|
|
- return to.path.indexOf(item) != -1
|
|
|
- })
|
|
|
- console.log(isBankLock,'isBankLock')
|
|
|
- if(isBankLock) {
|
|
|
+ // // //题库页面要检测是否需要锁定
|
|
|
+ // let isBankLock = bankAdmin.some(item => {
|
|
|
+ // return to.path.indexOf(item) != -1
|
|
|
+ // })
|
|
|
+ // console.log(isBankLock,'isBankLock')
|
|
|
+ // if(isBankLock) {
|
|
|
|
|
|
- //没有执行定时器,开启锁定
|
|
|
- if(!canToBank) {
|
|
|
- request
|
|
|
- .lockLockStatus({
|
|
|
- action: "bank",
|
|
|
- uuid:tools.getUuid()
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- //有其他端在操作,不能学习
|
|
|
- Message({
|
|
|
- type: "warning",
|
|
|
- message: res.msg,
|
|
|
- });
|
|
|
+ // //没有执行定时器,开启锁定
|
|
|
+ // if(!canToBank) {
|
|
|
+ // request
|
|
|
+ // .lockLockStatus({
|
|
|
+ // action: "bank",
|
|
|
+ // uuid:tools.getUuid()
|
|
|
+ // })
|
|
|
+ // .then((res) => {
|
|
|
+ // //有其他端在操作,不能学习
|
|
|
+ // Message({
|
|
|
+ // type: "warning",
|
|
|
+ // message: res.msg,
|
|
|
+ // });
|
|
|
|
|
|
- if(from.path=='/') {
|
|
|
- next('/')
|
|
|
- }
|
|
|
+ // if(from.path=='/') {
|
|
|
+ // next('/')
|
|
|
+ // }
|
|
|
|
|
|
- }).catch(err => {
|
|
|
- //可以学习,开启锁定
|
|
|
- canToBank = 1;
|
|
|
- request.lockLockAction({
|
|
|
- action:'bank',
|
|
|
- uuid:tools.getUuid()
|
|
|
- }).then(res => {
|
|
|
- })
|
|
|
- canToBank = setInterval(() => {
|
|
|
- request.lockLockAction({
|
|
|
- action:'bank',
|
|
|
- uuid:tools.getUuid()
|
|
|
- }).then(res => {
|
|
|
+ // }).catch(err => {
|
|
|
+ // //可以学习,开启锁定
|
|
|
+ // canToBank = 1;
|
|
|
+ // request.lockLockAction({
|
|
|
+ // action:'bank',
|
|
|
+ // uuid:tools.getUuid()
|
|
|
+ // }).then(res => {
|
|
|
+ // })
|
|
|
+ // canToBank = setInterval(() => {
|
|
|
+ // request.lockLockAction({
|
|
|
+ // action:'bank',
|
|
|
+ // uuid:tools.getUuid()
|
|
|
+ // }).then(res => {
|
|
|
|
|
|
- })
|
|
|
- }, 10000);
|
|
|
- next()
|
|
|
- })
|
|
|
+ // })
|
|
|
+ // }, 10000);
|
|
|
+ // next()
|
|
|
+ // })
|
|
|
|
|
|
- return;
|
|
|
- } else {
|
|
|
- //正在执行定时器,可以直接进入
|
|
|
- next()
|
|
|
- }
|
|
|
+ // return;
|
|
|
+ // } else {
|
|
|
+ // //正在执行定时器,可以直接进入
|
|
|
+ // next()
|
|
|
+ // }
|
|
|
|
|
|
- return;
|
|
|
- } else {
|
|
|
- //从题库页面离开删除锁定
|
|
|
+ // return;
|
|
|
+ // } else {
|
|
|
+ // //从题库页面离开删除锁定
|
|
|
|
|
|
- let isLeaveBank = bankAdmin.some(item => {
|
|
|
- return from.path.indexOf(item) != -1
|
|
|
- })
|
|
|
+ // let isLeaveBank = bankAdmin.some(item => {
|
|
|
+ // return from.path.indexOf(item) != -1
|
|
|
+ // })
|
|
|
|
|
|
- if(isLeaveBank) {
|
|
|
+ // if(isLeaveBank) {
|
|
|
|
|
|
- clearInterval(canToBank)
|
|
|
- canToBank = null;
|
|
|
- request.lockDelLock({
|
|
|
- action:'bank',
|
|
|
- uuid:tools.getUuid()
|
|
|
- }).then(res => {
|
|
|
+ // clearInterval(canToBank)
|
|
|
+ // canToBank = null;
|
|
|
+ // request.lockDelLock({
|
|
|
+ // action:'bank',
|
|
|
+ // uuid:tools.getUuid()
|
|
|
+ // }).then(res => {
|
|
|
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
- let isCourseLock = courseAdmin.some(item => {
|
|
|
- return to.path.indexOf(item) != -1
|
|
|
- })
|
|
|
+ // let isCourseLock = courseAdmin.some(item => {
|
|
|
+ // return to.path.indexOf(item) != -1
|
|
|
+ // })
|
|
|
|
|
|
- console.log(isCourseLock,'isCourseLock')
|
|
|
- if(isCourseLock) {
|
|
|
+ // console.log(isCourseLock,'isCourseLock')
|
|
|
+ // if(isCourseLock) {
|
|
|
|
|
|
- //没有执行定时器,开启锁定
|
|
|
- if(!canToCourse) {
|
|
|
+ // //没有执行定时器,开启锁定
|
|
|
+ // if(!canToCourse) {
|
|
|
|
|
|
- request.goodsDetail(to.params.goodsId).then(res => {
|
|
|
- //继续教育锁定
|
|
|
- if(res.data.educationName == '继续教育') {
|
|
|
- request
|
|
|
- .lockLockStatus({
|
|
|
- action: "jxjy",
|
|
|
- uuid:tools.getUuid()
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- //有其他端在操作,不能学习
|
|
|
- Message({
|
|
|
- type: "warning",
|
|
|
- message: res.msg,
|
|
|
- });
|
|
|
+ // request.goodsDetail(to.params.goodsId).then(res => {
|
|
|
+ // //继续教育锁定
|
|
|
+ // if(res.data.educationName == '继续教育') {
|
|
|
+ // request
|
|
|
+ // .lockLockStatus({
|
|
|
+ // action: "jxjy",
|
|
|
+ // uuid:tools.getUuid()
|
|
|
+ // })
|
|
|
+ // .then((res) => {
|
|
|
+ // //有其他端在操作,不能学习
|
|
|
+ // Message({
|
|
|
+ // type: "warning",
|
|
|
+ // message: res.msg,
|
|
|
+ // });
|
|
|
|
|
|
- if(from.path=='/') {
|
|
|
- next('/')
|
|
|
- }
|
|
|
+ // if(from.path=='/') {
|
|
|
+ // next('/')
|
|
|
+ // }
|
|
|
|
|
|
- }).catch(err => {
|
|
|
- //可以学习,开启锁定
|
|
|
- canToCourse = 1;
|
|
|
- request.lockLockAction({
|
|
|
- action:'jxjy',
|
|
|
- uuid:tools.getUuid()
|
|
|
- }).then(res => {
|
|
|
- })
|
|
|
- canToCourse = setInterval(() => {
|
|
|
- request.lockLockAction({
|
|
|
- action:'jxjy',
|
|
|
- uuid:tools.getUuid()
|
|
|
- }).then(res => {
|
|
|
+ // }).catch(err => {
|
|
|
+ // //可以学习,开启锁定
|
|
|
+ // canToCourse = 1;
|
|
|
+ // request.lockLockAction({
|
|
|
+ // action:'jxjy',
|
|
|
+ // uuid:tools.getUuid()
|
|
|
+ // }).then(res => {
|
|
|
+ // })
|
|
|
+ // canToCourse = setInterval(() => {
|
|
|
+ // request.lockLockAction({
|
|
|
+ // action:'jxjy',
|
|
|
+ // uuid:tools.getUuid()
|
|
|
+ // }).then(res => {
|
|
|
|
|
|
- })
|
|
|
- }, 10000);
|
|
|
- next()
|
|
|
- })
|
|
|
- } else {
|
|
|
- next()
|
|
|
- }
|
|
|
- })
|
|
|
+ // })
|
|
|
+ // }, 10000);
|
|
|
+ // next()
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // next()
|
|
|
+ // }
|
|
|
+ // })
|
|
|
|
|
|
|
|
|
- return;
|
|
|
- } else {
|
|
|
- //正在执行定时器,可以直接进入
|
|
|
- next()
|
|
|
- }
|
|
|
+ // return;
|
|
|
+ // } else {
|
|
|
+ // //正在执行定时器,可以直接进入
|
|
|
+ // next()
|
|
|
+ // }
|
|
|
|
|
|
- return;
|
|
|
- } else {
|
|
|
- //非题库页面删除锁定
|
|
|
- let isLeaveCouese = courseAdmin.some(item => {
|
|
|
- return from.path.indexOf(item) != -1
|
|
|
- })
|
|
|
+ // return;
|
|
|
+ // } else {
|
|
|
+ // //非题库页面删除锁定
|
|
|
+ // let isLeaveCouese = courseAdmin.some(item => {
|
|
|
+ // return from.path.indexOf(item) != -1
|
|
|
+ // })
|
|
|
|
|
|
- if(isLeaveCouese) {
|
|
|
+ // if(isLeaveCouese) {
|
|
|
|
|
|
- clearInterval(canToCourse)
|
|
|
- canToCourse = null;
|
|
|
- request.lockDelLock({
|
|
|
- action:'jxjy',
|
|
|
- uuid:tools.getUuid()
|
|
|
- }).then(res => {
|
|
|
+ // clearInterval(canToCourse)
|
|
|
+ // canToCourse = null;
|
|
|
+ // request.lockDelLock({
|
|
|
+ // action:'jxjy',
|
|
|
+ // uuid:tools.getUuid()
|
|
|
+ // }).then(res => {
|
|
|
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
next()
|
|
|
} else {
|