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

通用token校验

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