提交 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,11 +229,11 @@ 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{
checkHospitalStatus(userToken).then(res => {
const status = res.data.status;
if (status == 1) { // 机构状态正常
remind({ token: userToken }).then(resD => {
......@@ -286,8 +286,10 @@ export default {
})
});
}
})
}
})
});
}
},
......
......@@ -41,3 +41,9 @@ export const getRemindStatus = async (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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册