|
@@ -5,6 +5,7 @@
|
|
<div class="container">
|
|
<div class="container">
|
|
<div class="clearfix top-line">
|
|
<div class="clearfix top-line">
|
|
<el-button
|
|
<el-button
|
|
|
|
+ v-if="backNum"
|
|
class="float-right"
|
|
class="float-right"
|
|
type="primary"
|
|
type="primary"
|
|
size="small"
|
|
size="small"
|
|
@@ -185,19 +186,19 @@ export default {
|
|
...mapGetters(["userInfo"]),
|
|
...mapGetters(["userInfo"]),
|
|
},
|
|
},
|
|
beforeRouteEnter(to, from, next) {
|
|
beforeRouteEnter(to, from, next) {
|
|
- console.log(to,from)
|
|
|
|
next((vm) => {
|
|
next((vm) => {
|
|
if (from.path.includes("my-course-detail")) {
|
|
if (from.path.includes("my-course-detail")) {
|
|
vm.backNum = -2;
|
|
vm.backNum = -2;
|
|
|
|
+ } else if (from.path == '/login') {
|
|
|
|
+ vm.backNum = 0;
|
|
} else {
|
|
} else {
|
|
vm.backNum = -1;
|
|
vm.backNum = -1;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- console.log('this.$tools.isLogin()', this.$tools.isLogin())
|
|
|
|
|
|
+ console.log('是否登录了', this.$tools.isLogin())
|
|
if (!this.$tools.isLogin()) {
|
|
if (!this.$tools.isLogin()) {
|
|
- console.log('1111',this.$route)
|
|
|
|
this.setCurrentRouter(this.$route);
|
|
this.setCurrentRouter(this.$route);
|
|
this.$router.push({
|
|
this.$router.push({
|
|
path: "/login",
|
|
path: "/login",
|
|
@@ -227,6 +228,7 @@ export default {
|
|
this.studyRecordGetLastLive();
|
|
this.studyRecordGetLastLive();
|
|
},
|
|
},
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
|
|
+ if (!this.$tools.isLogin()) return
|
|
this.plv.liveSdk.destroy();
|
|
this.plv.liveSdk.destroy();
|
|
clearInterval(this.timer);
|
|
clearInterval(this.timer);
|
|
},
|
|
},
|