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

通用token校验

上级 5a35c6d9
...@@ -212,7 +212,23 @@ module.exports = { ...@@ -212,7 +212,23 @@ module.exports = {
return null return null
}, },
onAvatarError(e) { onAvatarError(e) {
e.target.src = 'https://file.yunqueyi.com/File/doctor_default.png'; e.target.src = 'https://file.yunqueyi.com/File/doctor_default.png';
}, },
// 通用token校验
commonCheckToken(noLoggedCallback) {
let param = {
token: this.token,
setEntry: true
};
this.GET("campaign/admin/task/checkToken", param).then(res => {
if (res.code !== "000000") {
this.goLogin();
} else {
noLoggedCallback && noLoggedCallback()
}
});
}
} }
} }
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
:changeErrorMsg="changeCardErrorMsg" :changeErrorMsg="changeCardErrorMsg"
:isShow="showChangeCard" :isShow="showChangeCard"
@cancle="cancleChangeCard" @cancle="cancleChangeCard"
@confirm="changeCardAction" @confirm="beforeChangeCardAction"
></ChangeCard> ></ChangeCard>
<Loading v-show="showLoading" /> <Loading v-show="showLoading" />
<div> <div>
...@@ -392,7 +392,7 @@ export default { ...@@ -392,7 +392,7 @@ export default {
this.GET(`portal/shareParam/queryByUuid`, param).then(res => { this.GET(`portal/shareParam/queryByUuid`, param).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
this.shareParam = JSON.parse(res.data || "{}"); this.shareParam = JSON.parse(res.data || "{}");
this.projectId = this.shareParam.projectId || 797; // 797 this.projectId = this.shareParam.projectId || 812; // 797 812
this.getProjectInfoById(); this.getProjectInfoById();
console.log('queryByUuid', res); console.log('queryByUuid', res);
} }
...@@ -445,12 +445,20 @@ export default { ...@@ -445,12 +445,20 @@ export default {
this.showChangeCard = false; this.showChangeCard = false;
}, },
// 激活 返回值:0绑定失败,1绑定成功 // 激活前
beforeChangeCardAction(cardKey) {
this.commonCheckToken( () => {
this.changeCardAction(cardKey);
})
},
// 激活Action 返回值:0绑定失败,1绑定成功
changeCardAction(cardKey) { changeCardAction(cardKey) {
let _this = this; let _this = this;
let param = { let param = {
cardKey: cardKey, cardKey: cardKey,
cardType: 3, cardType: 3,
channel: 3,
portalProjectId: this.projectId, portalProjectId: this.projectId,
setEntry: true setEntry: true
}; };
...@@ -526,9 +534,10 @@ export default { ...@@ -526,9 +534,10 @@ export default {
// this.$sendBuriedData({ // this.$sendBuriedData({
// component_tag: `882#88203` // component_tag: `882#88203`
// }); // });
let jumpUrl = getWebPageUrl(`profexam/#/goods-detail?goodsId=${this.goodsId}&token=${this.token}`); this.commonCheckToken( () => {
window.location.href = jumpUrl; let jumpUrl = getWebPageUrl(`profexam/#/goods-detail?goodsId=${this.cardInfo.id}&token=${this.token}`);
// "https://a.app.qq.com/o/simple.jsp?pkgname=com.picahealth.yunque"; window.location.href = jumpUrl;
})
}, },
// 首次进入考试时记录(点击‘我知道了’时调用) // 首次进入考试时记录(点击‘我知道了’时调用)
...@@ -547,14 +556,12 @@ export default { ...@@ -547,14 +556,12 @@ export default {
); );
}, },
//去激活
changeClick(msg) {
console.log("in changeClick");
this.showChangeCard = true;
// this.$sendBuriedData({ //去激活
// component_tag: `882#88202` changeClick() {
// }); this.commonCheckToken( () => {
this.showChangeCard = true;
})
}, },
scrollFun() { scrollFun() {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册