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

token获取方式等

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