App.vue 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <div id="app">
  3. <router-view v-if="isRouterAlive"></router-view>
  4. </div>
  5. </template>
  6. <script>
  7. import axios from 'axios'
  8. import { getOrgs, changeOrg } from "@/api/config";
  9. export default {
  10. name: "App",
  11. provide() {
  12. return {
  13. reload: this.reload
  14. };
  15. },
  16. data () {
  17. return {
  18. isRouterAlive: true,
  19. showErr: false,
  20. showWsErr: false,
  21. }
  22. },
  23. created(){
  24. // getOrgs().then(response => {
  25. // if (response.data.state === 1) {
  26. // var creator = response.data.data.creator;
  27. // console.log("creator", creator);
  28. // sessionStorage.setItem("org_id",creator.org_id);
  29. // sessionStorage.setItem("admin_user_id",creator.admin_user_id);
  30. // this.getToken(creator.org_id,creator.admin_user_id)
  31. // }
  32. // });
  33. },
  34. methods: {
  35. reload () {
  36. this.isRouterAlive = false
  37. this.$nextTick(function () {
  38. this.isRouterAlive = true
  39. })
  40. },
  41. },
  42. watch:{
  43. $route(to,from){
  44. if(to.path.indexOf('/patients/patient')== -1){
  45. window.sessionStorage.removeItem('patientKey')
  46. }
  47. }
  48. },
  49. };
  50. </script>
  51. <style>
  52. body .el-table th.gutter {
  53. display: table-cell !important;
  54. }
  55. </style>