socialLogin.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <div class="login">
  3. <span>已授权。。正在登录CPMS</span>
  4. <!-- 底部 -->
  5. <div class="el-login-footer">
  6. <span>Copyright © 2020-2022 Seashore.ept All Rights Reserved.</span>
  7. </div>
  8. </div>
  9. </template>
  10. <script>
  11. import {getAccessToken, getCodeImg} from "@/api/login";
  12. import Cookies from "js-cookie";
  13. import { encrypt, decrypt } from '@/utils/jsencrypt'
  14. import LangSelect from '@/components/LangSelect'
  15. import {updatePlantproglist} from "@/api/document/plantproglist";
  16. export default {
  17. name: "SocialLogin",
  18. components: { LangSelect },
  19. data() {
  20. return {
  21. code: null,
  22. loading: false,
  23. };
  24. },
  25. created() {
  26. let code = this.$route.query.code
  27. if (!code) {
  28. code = window.location.search.replace("?code=" , '')
  29. }
  30. this.code = code
  31. console.log(this.code)
  32. this.getAccessToken()
  33. },
  34. methods: {
  35. getAccessToken(){
  36. getAccessToken(this.code).then(response => {
  37. this.msgSuccess(this.$t('成功'));
  38. });
  39. }
  40. }
  41. };
  42. </script>
  43. <style rel="stylesheet/scss" lang="scss">
  44. .login {
  45. display: flex;
  46. justify-content: center;
  47. align-items: center;
  48. height: 100%;
  49. background-size: cover;
  50. }
  51. .title {
  52. margin: 0px auto 15px auto;
  53. text-align: center;
  54. color: #ffffff;
  55. }
  56. .login-form {
  57. position:absolute;
  58. top:50%;
  59. left:50%;
  60. transform:translate(-50%,-50%);
  61. /*实现块元素百分比下居中*/
  62. width:450px;
  63. padding:50px;
  64. background: #2a8db9db;
  65. box-sizing:border-box;
  66. box-shadow: 0px 15px 25px rgba(0,0,0,.5);
  67. border-radius:15px;
  68. .el-input {
  69. height: 38px;
  70. input {
  71. height: 38px;
  72. }
  73. }
  74. .input-icon {
  75. height: 39px;
  76. width: 14px;
  77. margin-left: 2px;
  78. }
  79. }
  80. .login-tip {
  81. font-size: 13px;
  82. text-align: center;
  83. color: #bfbfbf;
  84. }
  85. .login-code {
  86. width: 33%;
  87. height: 38px;
  88. float: right;
  89. img {
  90. cursor: pointer;
  91. vertical-align: middle;
  92. }
  93. }
  94. .el-dropdown {
  95. color: #ffffff;
  96. }
  97. .el-checkbox {
  98. color: #ffffff;
  99. }
  100. .el-login-footer {
  101. height: 40px;
  102. line-height: 40px;
  103. position: fixed;
  104. bottom: 0;
  105. width: 100%;
  106. text-align: center;
  107. color: #fff;
  108. font-family: Arial;
  109. font-size: 12px;
  110. letter-spacing: 1px;
  111. }
  112. .login-code-img {
  113. height: 38px;
  114. }
  115. </style>
  116. <style scoped>
  117. .el-button--primary {
  118. color: #FFFFFF;
  119. background-color: #40a9ff;
  120. border-color: #40a9ff;
  121. }
  122. .el-button:hover, .el-button:focus {
  123. border-color: #6abfff;
  124. background-color: #6abfff;
  125. }
  126. </style>