提交 376280f2 编写于 作者: tao.wu's avatar tao.wu

校验token有效玉佛

上级 920de312
......@@ -66,7 +66,7 @@
</template>
<script>
import { Toast } from 'vant';
import { remind, getRemindStatus, checkHospitalStatus, getCnt } from '@/service';
import { remind, getRemindStatus, checkHospitalStatus, getCnt, checkToken } from '@/service';
import h5header from '@/components/h5header';
import shareContainer from '@/components/share-container';
import { BASE_URL } from '@/utils/enumerate';
......@@ -229,65 +229,67 @@ export default {
}
this.$rocNative.getToken().then(data => {
const { userToken } = data;
checkHospitalStatus(userToken).then(res => {
alert(JSON.stringify(res))
checkToken(userToken).then(res=>{
if(res.code=='200006' || res.code == '200000'){
this.$rocNative.gotoLogin();
}else{
const status = res.data.status;
if (status == 1) { // 机构状态正常
remind({ token: userToken }).then(resD => {
if (resD.code == '000000') {
// if(!flag){
this.$dialog.alert({
title: '设置提醒成功',
message: '云鹊奖活动正式时间:12月16日 10:00开始,我们将会以APP消息提醒和短信形式提醒道您,请记得及时参与活动',
confirmButtonText: '我知道了',
className: 'remind-success'
});
// }
this.remindStatus = true;
} else {
this.$toast(resD.message)
}
})
} else if (status == 15) { // 15创建机构审核中
let hospital = '默认机构名称';
if (res.data && res.data.hospital) {
hospital = res.data.hospital
}
this.$dialog.confirm({
title: '提醒',
message: `抱歉,您创建的机构【${hospital}】正在审核中,审核通过后可参与活动<br/><br/>如有疑问可联系客:<span>400-920-8877</span><br/>(周一至周五9:00-18:00)`,
confirmButtonText: '查看进度',
cancelButtonText: '我知道了',
className: 'remind-success',
}).then(() => {
this.checkVersion(()=>{
if (this.$rocNative.isAndroid) {
this.$rocNative.setNeedClearUrl({ url: 'year_end_ssr' });
}
this.$rocNative.gotoInstitutionalReview({ url: window.location.href });
});
});
} else { // 除了1都是未加入机构
this.$dialog.confirm({
title: '提醒',
message: '抱歉,您暂未加入机构,需加入机构才可参与活动',
confirmButtonText: '加入机构',
cancelButtonText: '我知道了',
className: 'remind-success',
}).then(() => {
this.checkVersion(()=>{
if (this.$rocNative.isAndroid) {
this.$rocNative.setNeedClearUrl({ url: 'year_end_ssr' });
checkHospitalStatus(userToken).then(res => {
const status = res.data.status;
if (status == 1) { // 机构状态正常
remind({ token: userToken }).then(resD => {
if (resD.code == '000000') {
// if(!flag){
this.$dialog.alert({
title: '设置提醒成功',
message: '云鹊奖活动正式时间:12月16日 10:00开始,我们将会以APP消息提醒和短信形式提醒道您,请记得及时参与活动',
confirmButtonText: '我知道了',
className: 'remind-success'
});
// }
this.remindStatus = true;
} else {
this.$toast(resD.message)
}
this.$rocNative.gotoActivityHospital({ url: window.location.href });
})
});
}
} else if (status == 15) { // 15创建机构审核中
let hospital = '默认机构名称';
if (res.data && res.data.hospital) {
hospital = res.data.hospital
}
this.$dialog.confirm({
title: '提醒',
message: `抱歉,您创建的机构【${hospital}】正在审核中,审核通过后可参与活动<br/><br/>如有疑问可联系客:<span>400-920-8877</span><br/>(周一至周五9:00-18:00)`,
confirmButtonText: '查看进度',
cancelButtonText: '我知道了',
className: 'remind-success',
}).then(() => {
this.checkVersion(()=>{
if (this.$rocNative.isAndroid) {
this.$rocNative.setNeedClearUrl({ url: 'year_end_ssr' });
}
this.$rocNative.gotoInstitutionalReview({ url: window.location.href });
});
});
} else { // 除了1都是未加入机构
this.$dialog.confirm({
title: '提醒',
message: '抱歉,您暂未加入机构,需加入机构才可参与活动',
confirmButtonText: '加入机构',
cancelButtonText: '我知道了',
className: 'remind-success',
}).then(() => {
this.checkVersion(()=>{
if (this.$rocNative.isAndroid) {
this.$rocNative.setNeedClearUrl({ url: 'year_end_ssr' });
}
this.$rocNative.gotoActivityHospital({ url: window.location.href });
})
});
}
})
}
})
});
}
},
......
......@@ -40,4 +40,10 @@ export const getRemindStatus = async (token) => {
token: token
}
})
}
export const checkToken = async(token) => {
return request({
url: `campaign/admin/task/checkToken?token=${token}`,
})
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册