third-login.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <div
  3. v-if="false && (siteData.wechatLogin || siteData.faceLogin)"
  4. style="line-height: 35px; margin-top: 10px"
  5. >
  6. <div class="title-line">其它方式登录</div>
  7. <div style="display: flex">
  8. <a v-if="siteData.wechatLogin" class="third-item wechat-icon">
  9. <svg-icon icon-class="wechat" @click="wechatLogin" />
  10. <div>微信登录</div>
  11. </a>
  12. <a v-if="siteData.faceLogin" class="third-item face-icon">
  13. <svg-icon icon-class="face-id" @click="faceLogin" />
  14. <div>人脸登录</div>
  15. </a>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. import { mapGetters } from "vuex";
  21. import { apiGetWechatUrl } from "@/api/ability/login";
  22. export default {
  23. name: "ThirdLogin",
  24. data() {
  25. return {
  26. loading1: false,
  27. loading2: false,
  28. loginForm: {},
  29. };
  30. },
  31. computed: {
  32. ...mapGetters(["siteData"]),
  33. },
  34. methods: {
  35. wechatLogin() {
  36. // 获得跳转地址并跳转
  37. apiGetWechatUrl({ state: "pc" }).then((res) => {
  38. window.location = res.data.url;
  39. });
  40. },
  41. faceLogin() {
  42. this.$router.push({ name: "FaceLogin" });
  43. },
  44. },
  45. };
  46. </script>
  47. <style scoped>
  48. .third-item {
  49. margin-right: 10px;
  50. color: #888;
  51. display: flex;
  52. flex-direction: column;
  53. justify-content: center;
  54. align-items: center;
  55. }
  56. .third-item .svg-icon {
  57. width: 22px;
  58. height: 22px;
  59. cursor: pointer;
  60. }
  61. .third-item div {
  62. font-size: 12px;
  63. }
  64. .wechat-icon :hover {
  65. color: #1aac1a;
  66. }
  67. .face-icon :hover {
  68. color: #ff8000;
  69. }
  70. </style>