兰宝车间质量管理系统-前端
三个三
2023-06-20 3b4ac3e525bdc51cf5176d3d52cd01d0a9c67d7d
src/views/login.vue
@@ -36,6 +36,20 @@
          <router-link class="link-type" :to="'/register'">立即注册</router-link>
        </div>
      </el-form-item>
      <div style="display: flex;justify-content: flex-end;flex-direction: row;">
        <el-button circle>
          <svg-icon icon-class="qq" @click="doSocialLogin('QQ')" />
        </el-button>
        <el-button circle>
          <svg-icon icon-class="wechat" @click="doSocialLogin('Wechat')" />
        </el-button>
        <el-button circle>
          <svg-icon icon-class="gitee" @click="doSocialLogin('gitee')" />
        </el-button>
        <el-button circle>
          <svg-icon icon-class="github" @click="doSocialLogin('github')" />
        </el-button>
      </div>
    </el-form>
    <!--  底部  -->
    <div class="el-login-footer">
@@ -46,11 +60,12 @@
<script setup lang="ts">
import { getCodeImg, getTenantList } from '@/api/login';
import { authBinding } from '@/api/system/social/auth';
import Cookies from 'js-cookie';
import { encrypt, decrypt } from '@/utils/jsencrypt';
import { useUserStore } from '@/store/modules/user';
import { LoginData, TenantVO } from '@/api/types';
import { FormRules } from 'element-plus';
import { ElForm, FormRules } from 'element-plus';
import { to } from 'await-to-js';
const userStore = useUserStore();
@@ -162,6 +177,21 @@
        }
    }
}
/**
 * 第三方登录
 * @param type
 */
const doSocialLogin = (type: string) => {
  authBinding(type).then((res: any) => {
    if (res.code === 200) {
      window.location.href = res.msg;
  } else {
      ElMessage.error(res.msg);
    }
  });
};
onMounted(() => {
    getCode();
@@ -179,6 +209,7 @@
  background-image: url("../assets/images/login-background.jpg");
  background-size: cover;
}
.title {
  margin: 0px auto 30px auto;
  text-align: center;
@@ -190,32 +221,39 @@
  background: #ffffff;
  width: 400px;
  padding: 25px 25px 5px 25px;
  .el-input {
    height: 40px;
    input {
      height: 40px;
    }
  }
  .input-icon {
    height: 39px;
    width: 14px;
    margin-left: 0px;
  }
}
.login-tip {
  font-size: 13px;
  text-align: center;
  color: #bfbfbf;
}
.login-code {
  width: 33%;
  height: 40px;
  float: right;
  img {
    cursor: pointer;
    vertical-align: middle;
  }
}
.el-login-footer {
  height: 40px;
  line-height: 40px;
@@ -228,6 +266,7 @@
  font-size: 12px;
  letter-spacing: 1px;
}
.login-code-img {
  height: 40px;
  padding-left: 12px;