index.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <div
  3. class="home"
  4. :style="{
  5. backgroundImage: `url(${require('@/assets/images/project/bg.png')})`,
  6. }"
  7. >
  8. <div class="h-con">
  9. <img class="h-btn" :src="require('@/assets/images/project/icon/loginsuccess.png')" alt="" />
  10. <p>登录成功,请关闭此页。</p>
  11. </div>
  12. </div>
  13. </template>
  14. <script>
  15. let getQueryVariable = (variable)=> {
  16. let search = window.location.hash.replace('#/logintips','')
  17. var query = search.substring(1);
  18. var vars = query.split("&");
  19. for (var i=0;i<vars.length;i++) {
  20. var pair = vars[i].split("=");
  21. if(pair[0] == variable){return pair[1];}
  22. }
  23. return(false);
  24. }
  25. export default {
  26. mounted(){
  27. this.$nextTick(()=>{
  28. localStorage.setItem('token',getQueryVariable('token'))
  29. localStorage.setItem('sign',getQueryVariable('sign'))
  30. })
  31. }
  32. };
  33. </script>
  34. <style lang="less" scoped>
  35. .home {
  36. width: 100%;
  37. height: 100%;
  38. background-repeat: no-repeat;
  39. background-color: #10337f;
  40. background-size: 100% auto;
  41. background-position: bottom left;
  42. .h-con {
  43. width: 70%;
  44. color: #fff;
  45. text-align: center;
  46. position: absolute;
  47. top: 50%;
  48. left: 50%;
  49. transform: translate(-50%,-50%);
  50. >img{
  51. width: 150px;
  52. margin-bottom: 30px;
  53. }
  54. >p{
  55. font-size: 26px;
  56. }
  57. }
  58. }
  59. @media screen and (max-width:800px) {
  60. .home {
  61. .h-con {
  62. >img{
  63. width: 20%;
  64. margin-bottom: 30px;
  65. }
  66. >p{
  67. font-size: 18px;
  68. width: 100%;
  69. }
  70. }
  71. }
  72. }
  73. </style>