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

校验token有效玉佛

上级 920de312
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
</template> </template>
<script> <script>
import { Toast } from 'vant'; 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 h5header from '@/components/h5header';
import shareContainer from '@/components/share-container'; import shareContainer from '@/components/share-container';
import { BASE_URL } from '@/utils/enumerate'; import { BASE_URL } from '@/utils/enumerate';
...@@ -229,65 +229,67 @@ export default { ...@@ -229,65 +229,67 @@ export default {
} }
this.$rocNative.getToken().then(data => { this.$rocNative.getToken().then(data => {
const { userToken } = data; const { userToken } = data;
checkHospitalStatus(userToken).then(res => { checkToken(userToken).then(res=>{
alert(JSON.stringify(res))
if(res.code=='200006' || res.code == '200000'){ if(res.code=='200006' || res.code == '200000'){
this.$rocNative.gotoLogin(); this.$rocNative.gotoLogin();
}else{ }else{
const status = res.data.status; checkHospitalStatus(userToken).then(res => {
if (status == 1) { // 机构状态正常 const status = res.data.status;
remind({ token: userToken }).then(resD => { if (status == 1) { // 机构状态正常
if (resD.code == '000000') { remind({ token: userToken }).then(resD => {
// if(!flag){ if (resD.code == '000000') {
this.$dialog.alert({ // if(!flag){
title: '设置提醒成功', this.$dialog.alert({
message: '云鹊奖活动正式时间:12月16日 10:00开始,我们将会以APP消息提醒和短信形式提醒道您,请记得及时参与活动', title: '设置提醒成功',
confirmButtonText: '我知道了', message: '云鹊奖活动正式时间:12月16日 10:00开始,我们将会以APP消息提醒和短信形式提醒道您,请记得及时参与活动',
className: 'remind-success' confirmButtonText: '我知道了',
}); className: 'remind-success'
// } });
this.remindStatus = true; // }
} else { this.remindStatus = true;
this.$toast(resD.message) } 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' });
} }
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) => { ...@@ -40,4 +40,10 @@ export const getRemindStatus = async (token) => {
token: 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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册