App.vue 950 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <div id="app">
  3. <router-view />
  4. </div>
  5. </template>
  6. <script>
  7. export default {
  8. data(){
  9. return {}
  10. },
  11. created() {
  12. const href = window.location.href;
  13. // 路由
  14. // const route = href.split("?")[0];
  15. // 参数处理
  16. let params = href.split("?")[1];
  17. if (!params) {
  18. // 参数有问题
  19. return false;
  20. }
  21. params = decodeURIComponent(params);
  22. // params = "categoryId=NTXT&ProjectID=5&BuildingID=1&FloorID=1"; // mock 参数
  23. const paramsArr = params.split("&");
  24. const obj = {};
  25. paramsArr.map(item => {
  26. const arr = item.split("=");
  27. obj[arr[0]] = arr[1];
  28. });
  29. this.urlMsg = obj;
  30. this.$store.commit("SETSSOTOKEN", this.urlMsg.token);
  31. }
  32. }
  33. </script>
  34. <style lang="less">
  35. #app {
  36. width: 100%;
  37. height: 100%;
  38. }
  39. html {
  40. margin: 0;
  41. width: 100%;
  42. height: 100%;
  43. }
  44. body {
  45. margin: 0;
  46. width: 100%;
  47. height: 100%
  48. }
  49. canvas:focus{
  50. outline: none;
  51. }
  52. </style>