Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

verify_token.vue 1.4KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <div>
  3. <h2 style="text-align:center;">加载中...</h2>
  4. </div>
  5. </template>
  6. <script>
  7. export default {
  8. created() {
  9. // alert(this.$route.query.token)
  10. this.$store.dispatch('VerifyToken', this.$route.query.token).then(() => {
  11. this.$store.dispatch('xt_GenerateRoutes', this.$store.getters.current_role_urls).then(() => {
  12. this.$store.dispatch('VerifyConfigList').then(() => {
  13. // alert('token 验证成功')
  14. // console.log(this.$store.getters.xt_permission.addRouters)
  15. this.$router.addRoutes(this.$store.getters.xt_permission.addRouters) // 动态添加可访问路由表
  16. // next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
  17. this.$router.replace({ path: '/dialysis/dialysisrecord' })
  18. })
  19. })
  20. }).catch((error) => {
  21. // alert('token 验证失败' + error)
  22. if (error.code == 6016 || error.code == 6017) {
  23. window.location.href = process.env.BASE_API + "/handle_error?code=" + error.code
  24. } else if (error.code == 6008) { // 令牌无效
  25. window.location.href = process.env.BASE_API + '/login?relogin=true'
  26. } else {
  27. this.$message.error("token 验证失败: " + error.msg)
  28. // alert('token 验证失败' + error.msg)
  29. // window.location.href = process.env.BASE_API + '/login'
  30. }
  31. })
  32. }
  33. }
  34. </script>