gaoluyang
2025-03-21 f9d1ac78b245cb672342e96cf0e905b812352651
src/views/login.vue
@@ -38,6 +38,7 @@
            <router-link class="link-type" :to="'/register'">立即注册</router-link>
          </div>
        </el-form-item>
        <el-button v-if="true" type="primary" plain @click="goLogin">集团集成登录</el-button>
      </el-form>
    </div>
    <!--  底部  -->
@@ -48,7 +49,7 @@
</template>
<script>
import { getCodeImg } from "@/api/login";
import { getCodeImg, getSsoAuthUrl } from "@/api/login";
import Cookies from "js-cookie";
import { encrypt, decrypt } from '@/utils/jsencrypt'
@@ -58,8 +59,8 @@
    return {
      codeUrl: "",
      loginForm: {
        username: "admin",
        password: "admin123",
        username: "ZT-",
        password: "",
        rememberMe: false,
        code: "",
        uuid: ""
@@ -94,6 +95,11 @@
    this.getCookie();
  },
  methods: {
    async goLogin() {
      await getSsoAuthUrl().then(res => {
        window.location.href = res.data
      })
    },
    getCode() {
      getCodeImg().then(res => {
        this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
@@ -127,7 +133,7 @@
            Cookies.remove('rememberMe');
          }
          this.$store.dispatch("Login", this.loginForm).then(() => {
            this.$router.push({ path: this.redirect || "/" }).catch(() => { });
            this.$router.push({ path: "/" }).catch(() => { });
          }).catch(() => {
            this.loading = false;
            if (this.captchaEnabled) {
@@ -142,14 +148,14 @@
</script>
<style rel="stylesheet/scss" lang="scss">
//.login {
//  display: flex;
//  justify-content: center;
//  align-items: center;
//  height: 100%;
//  background-image: url("../assets/images/login-background.jpg");
//  background-size: cover;
//}
.login {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  background-image: url("../assets/images/login-background.jpg");
  background-size: cover;
}
.login {
  width: 100vw;
  height: 100vh;