App.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <div id="app">
  3. <HeaderBanner></HeaderBanner>
  4. <Navigation :navTitle1='navTitle1' :navTitle2='navTitle2'></Navigation>
  5. <div class="app_content">
  6. <div class="router">
  7. <LoginInfo></LoginInfo>
  8. <Routerbanner
  9. @change_nav="changeNav"
  10. :isManufacturer="isManufacturer"
  11. />
  12. </div>
  13. <div class="router_view">
  14. <router-view :isManufacturer="isManufacturer"></router-view>
  15. </div>
  16. </div>
  17. <FooterBanner/>
  18. <notifications></notifications>
  19. </div>
  20. </template>
  21. <script>
  22. import HeaderBanner from "./components/HeaderBanner";
  23. import Navigation from "./components/Navigation";
  24. import LoginInfo from "./components/LoginInfo";
  25. import Routerbanner from "./components/RouterBanner";
  26. import FooterBanner from "./components/Footerbanner";
  27. export default {
  28. components: {
  29. HeaderBanner,
  30. Navigation,
  31. LoginInfo,
  32. Routerbanner,
  33. FooterBanner
  34. },
  35. data() {
  36. return {
  37. navTitle1: ' > 数据管理',
  38. navTitle2: '',
  39. isManufacturer: 'manufacturer', // distributor 经销商 manufacturer 厂商
  40. }
  41. },
  42. methods: {
  43. // 点击路由,导航栏对应变化
  44. changeNav: function(navTitle1, navTitle2){
  45. this.navTitle1 = ' > ' + navTitle1;
  46. if (navTitle2) {
  47. this.navTitle2 = ' > ' + navTitle2;
  48. } else {
  49. this.navTitle2 = '';
  50. }
  51. },
  52. // 测试接口
  53. getData() {
  54. // 正常token
  55. // dXNlcklkPTEyMyZhY2NvdW50PWRmc2FmYWVyJmZyb209c2l3ZWkmdGltZXN0YW1wPTE2MTY4NDYxMzkmc2lnbj1mOWUwNzJhZGUwODE4YjhhNzMzN2I0ZTMzMzU2OWJjOA==
  56. let query = this.$route.query || {};
  57. let token = query.token || '';
  58. console.log('token:', token);
  59. if(!token) {
  60. // alert('token值为空');
  61. return
  62. }
  63. this.$http({
  64. method: 'post',
  65. url: '/auth/checkSign',
  66. data: {
  67. token: token
  68. }
  69. }).then((res) => {
  70. console.log(res);
  71. if(res.status === 200){
  72. if(res.data.code === 200) {
  73. console.log(res.data, '200');
  74. }else {
  75. let message = res.data.message;
  76. console.log('message', message);
  77. alert(message);
  78. }
  79. }
  80. }).catch((err) => {
  81. alert('无法校验的字符串');
  82. console.log(err);
  83. })
  84. }
  85. },
  86. mounted() {
  87. },
  88. created() {
  89. this.getData();
  90. }
  91. };
  92. </script>
  93. <style src="../node_modules/vue-notifyjs/themes/default.css"></style>
  94. <style lang="less">
  95. * {
  96. padding: 0;
  97. margin: 0;
  98. list-style: none;
  99. color: #333;
  100. font-size: 12px;
  101. }
  102. button{
  103. border: none;
  104. background-color: #0056A0;
  105. height: 30px;
  106. width: 58px;
  107. color: #fff;
  108. font-weight: 400px;
  109. font-family: Arial;
  110. margin-left: 18px;
  111. font-size: 14px;
  112. &:hover{
  113. cursor: pointer;
  114. }
  115. }
  116. .current_button{
  117. background-color: #0056A0;
  118. height: 30px;
  119. width: 58px;
  120. line-height: 30px;
  121. text-align: center;
  122. color: #fff;
  123. font-weight: 400px;
  124. font-family: Arial;
  125. margin-left: 18px;
  126. font-size: 14px;
  127. &:hover{
  128. cursor: pointer;
  129. }
  130. }
  131. #app {
  132. background-color: #eeeeee;
  133. height: 100%;
  134. min-height: 100vh;
  135. .app_content {
  136. width: 1190px;
  137. margin: 0 auto;
  138. font-size: 12px;
  139. color: #333;
  140. font-family: "微软雅黑";
  141. display: flex;
  142. justify-content: space-between;
  143. .router{
  144. width: 150px;
  145. height: 100%;
  146. background-color: #d4d4d4;
  147. height: auto;
  148. min-height: 50vh;
  149. }
  150. .router_view{
  151. width: 1030px;
  152. }
  153. }
  154. }
  155. @media screen and (max-width: 1190px) {
  156. #app{
  157. width: 1190px;
  158. }
  159. }
  160. </style>