提交 9feadead 编写于 作者: guangjun.yang's avatar guangjun.yang

token获取方式等

上级 87d70631
......@@ -67,11 +67,6 @@
</van-collapse-item>
</van-collapse>
</div>
<van-dialog
v-model="dialogState"
title="标题"
>
</van-dialog>
</section>
</template>
......@@ -108,8 +103,7 @@ export default {
appVersion: "200",
hocImg: require("../../images/has-owner-cert.png"),
activeNames: [1],
dialogState: false,
// projectId: 1
token: '',
};
},
props: {
......@@ -150,9 +144,6 @@ export default {
default: 0
}
},
computed: {
...mapGetters(["userInfo"])
},
components: {
MergeTitle,
CertShow,
......@@ -170,14 +161,12 @@ export default {
mounted() {
},
created() {
// this.projectId = this.$route.query.id;
this.token = this.$store.state.user.token;
},
methods: {
// 跳转到考试或课程 type 1: 考试; 2: 课程
// 如果是考试,将根据appVersion判断是新考试还是老考试,如果是301或之前的,都是老考试
gotoExamOrCourse(item) {
this.$parent.$refs.tcPlayerRef && this.$parent.$refs.tcPlayerRef.pause();
if(!this.logged) {
if(item.type == 1) {
Toast('请前往云鹊医APP参加考试');
......@@ -212,13 +201,28 @@ export default {
},
// 跳转到课程
gotoCourse: function(courseId) {
gotoCourse(courseId) {
let _this = this;
let param = {
token: _this.token,
setEntry: true
};
this.GET("campaign/admin/task/checkToken", param).then(res => {
if (res.code !== "000000") {
Toast('登陆后可学习课程');
} else {
jumpToCourse(courseId);
}
});
},
// 跳转到课程
jumpToCourse: function(courseId) {
if(!isWeiXin()) {
Toast('请前往云鹊医APP学习课程');
return;
}
let token = localStorage.getItem('token');
let jumpUrl = getWebPageUrl(`profexam/#/course-detail?courseId=${courseId}&projectId=${this.projectId}&token=${token}`);
let jumpUrl = getWebPageUrl(`profexam/#/course-detail?courseId=${courseId}&projectId=${this.projectId}&token=${this.token}`);
window.location.href = jumpUrl;
},
// 跳转到考试
......@@ -241,7 +245,7 @@ export default {
let param = {
expandKeys: activeNames,
setEntry: true,
token: this.userInfo.userToken,
token: this.token,
}
this.POST("portal/portalApp/updateExpandStatus?projectId="+this.projectId, param).then(res => {
});
......
......@@ -40,10 +40,6 @@
</div>
</pica-video>
</div>
<!-- <div class="sk-btn-cover-new" @click="continueStudy()" v-if="bannerType == 2 && hasBindCard" >
<span :class="{'android': isAndroid}">继续学习</span>
</div> -->
<!-- 项目标题 -->
<CommonDescription
......@@ -215,9 +211,6 @@ import CommonDescription from "@/components/common/common-description";
import CommonSpliteLine from "@/components/common/common-splite-line";
import CellListDetailShare from "@/components/business/cell-list-detail-share";
// import NoPermContent from "@/components/business/no-perm-content";
// import CommonBannerVideo from "@/components/common/common-banner-video";
import CommonTcPlayer from "@/components/common/common-tcplayer";
import Loading from "@/components/common/common-loading";
import CmeStep from "@/components/cme/cme-step";
......@@ -343,13 +336,13 @@ export default {
advertInfoList: [],
showChangeCard: false, //是否展示激活弹框,
changeCardErrorMsg: "",
continueStudyType: 0,
skCourseId: 0,
isShowSkDialog: false,
isShowEndDialog: false,
isShowFFDialog: false,
needShort: false,
uuid: '',
token: ''
};
},
components: {
......@@ -358,7 +351,6 @@ export default {
CommonSpliteLine,
CellListDetailShare,
Loading,
CommonTcPlayer,
CmeStep,
BasicInfo,
LearnKnow,
......@@ -396,6 +388,7 @@ export default {
location.replace(shareUrl);
}
const { token, info } = this.$store.state.user;
this.token = token;
// 如果有token,但没有用户信息,则获取用户信息
if (token && !info.id) {
this.$store.dispatch('getUserInfo');
......@@ -468,7 +461,6 @@ export default {
if(res.data == 0) {
_this.changeCardErrorMsg = "请输入正确的激活码";
} else {
_this.$refs.tcPlayerRef && _this.$refs.tcPlayerRef.pause();
_this.showChangeCard = false;
Toast("激活成功,开始学习");
_this.getProjectParticularsV2();
......@@ -571,7 +563,6 @@ export default {
// this.$sendBuriedData({
// component_tag: `882#88203`
// });
this.$refs.tcPlayerRef && this.$refs.tcPlayerRef.pause();
window.location.href =
"https://a.app.qq.com/o/simple.jsp?pkgname=com.picahealth.yunque";
},
......@@ -580,7 +571,7 @@ export default {
firstIntoExamAction() {
let _this = this;
let param = {
token: _this.userInfo.userToken || this.token,
token: _this.token,
setEntry: true
};
this.NEW_POST(`cme/project/${_this.projectId}/firstIntoExam`, param).then(
......@@ -596,14 +587,12 @@ export default {
checkToken() {
let _this = this;
let param = {
token: _this.userInfo.userToken || _this.token,
token: _this.token,
setEntry: true
};
this.GET("campaign/admin/task/checkToken", param).then(res => {
if (res.code !== "000000") {
//未登录 跳转登录页
console.log("跳登录");
_this.$refs.tcPlayerRef && _this.$refs.tcPlayerRef.pause();
rocNative.gotoLogin();
} else {
// if (!_this.premissionFlag) {
......@@ -620,7 +609,7 @@ export default {
let param = {
id: _this.projectId,
creditId: _this.project.creditId,
token: _this.userInfo.userToken || this.token,
token: _this.token,
setEntry: true
};
_this.NEW_POST("cme/credit/rangeCheck", param).then(res => {
......@@ -645,7 +634,7 @@ export default {
let param = {
id: _this.projectId,
creditId: _this.project.creditId,
token: _this.userInfo.userToken || this.token,
token: _this.token,
setEntry: true
};
_this.NEW_POST("cme/credit/applyCheck", param).then(res => {
......@@ -765,8 +754,7 @@ export default {
getProjectParticularsV2() {
let _this = this;
let param = {
// token: _this.userInfo.userToken || this.token,
token: this.$store.state.user.token || this.token,
token: _this.token,
setEntry: true
};
let videoUrl = this.$route.query.videoUrl || '';
......@@ -988,42 +976,6 @@ export default {
}
},
// 查找没有学习完成的课程或考试
continueStudy() {
let courseIdOrExamId = '';
let portalModuleDTOS = [];
let contentList = [];
let item = {};
let firstItem = null;
outloop: for(let i = 0; i < this.projectComponentDTOS.length; i ++) {
portalModuleDTOS = this.projectComponentDTOS[i].portalModuleDTOS;
for(let j = 0; j < portalModuleDTOS.length; j ++) {
contentList = portalModuleDTOS[j].contentList;
for(let k = 0; k < contentList.length; k ++) {
item = contentList[k];
if(!firstItem && item.id) {
firstItem = item;
}
if( (item.type == 1 && item.id && (item.useFlag != 2) && (item.status == 11 || item.status == 12))
|| (item.type == 2 && item.id && (item.useFlag != 2) && (item.status == 21 || item.status == 22)) ) {
this.continueStudyType = item.type;
this.skCourseId = item.id;
break outloop;
}
}
}
}
if(!this.skCourseId) {
this.continueStudyType = firstItem.type;
this.skCourseId = firstItem.id;
}
console.log('continueStudyType', this.continueStudyType, 'skCourseId', this.skCourseId);
if(this.continueStudyType == 1) {
this.gotoExamNew();
} else {
this.gotoCourseNew();
}
},
// 跳转到考试
gotoExamNew: function() {
......@@ -1034,12 +986,6 @@ export default {
gotoCourseNew: function() {
window.location.href = ""
},
goBuyKc(type) {
this.$refs.tcPlayerRef && this.$refs.tcPlayerRef.pause();
this.isShowSkDialog = false;
type == 2 && this.confirm();
},
}
};
</script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册