艺术家
2025-06-04 772190e7b2e3f6ef0695ba54d9209324acdcb30a
ÏîÄ¿´úÂë/ÉìËõ¸Ë/client/src/views/Login.vue
@@ -2,6 +2,32 @@
  <div class="login-container">
    <div class="login-header">
      <img src="../assets/login/login-text.png" alt="" />
      <div>
        <img
          v-if="!isFullscreen"
          style="
            width: 1.88rem;
            height: 1.88rem;
            margin-right: 1.81rem;
            cursor: pointer;
          "
          src="@/assets/screen.png"
          alt=""
          @click="screenonToggle"
        />
        <img
          v-if="isFullscreen"
          style="
            width: 1.88rem;
            height: 1.88rem;
            margin-right: 1.81rem;
            cursor: pointer;
          "
          src="@/assets/exitscreen.png"
          alt=""
          @click="screenonToggle"
        />
      </div>
    </div>
    <div class="login-box">
      <!-- å·¦ä¾§å›¾ç‰‡ -->
@@ -25,7 +51,7 @@
          <el-form-item prop="userName">
            <el-input
              v-model="loginForm.userName"
              style="height: 3.13rem"
              style="height: 3.13rem; width: 20.19rem"
              ref="userNameRef"
              type="text"
              size="large"
@@ -37,7 +63,7 @@
            <el-input
              show-password
              v-model="loginForm.password"
              style="height: 3.13rem"
              style="height: 3.13rem; width: 20.19rem"
              type="password"
              size="large"
              auto-complete="off"
@@ -46,7 +72,7 @@
            </el-input>
          </el-form-item>
          <el-form-item prop="verificationCode">
          <!-- <el-form-item prop="verificationCode">
            <div style="display: flex">
              <el-input
                v-model="loginForm.verificationCode"
@@ -66,7 +92,7 @@
                />
              </div>
            </div>
          </el-form-item>
          </el-form-item> -->
          <el-form-item>
            <el-button
              :loading="loading"
@@ -224,8 +250,9 @@
<script setup>
import { getCodeImg, login, CleanUnusedImages } from "@/api/login";
import { useRouter, useRoute } from "vue-router";
import { getCurrentInstance, ref, nextTick, onMounted } from "vue";
import { getCurrentInstance, ref, nextTick, onMounted, onUnmounted } from "vue";
import { ElMessage } from "element-plus";
import screenfull from "screenfull";
import store from "@/store";
import axios from "axios";
@@ -249,7 +276,7 @@
const loginForm = ref({
  userName: "",
  password: "",
  verificationCode: "",
  verificationCode: "1234",
  UUID: undefined,
  tenantId: "0",
});
@@ -528,6 +555,28 @@
    }, 3000);
  }
};
// æ˜¯å¦å…¨å±
const isFullscreen = ref(false);
// ç›‘听变化
const screenchange = () => {
  isFullscreen.value = screenfull.isFullscreen;
};
// åˆ‡æ¢äº‹ä»¶
const screenonToggle = () => {
  screenfull.toggle();
};
// è®¾ç½®ä¾¦å¬å™¨
onMounted(() => {
  screenfull.on("screenchange", screenchange);
});
// åˆ é™¤ä¾¦å¬å™¨
onUnmounted(() => {
  screenfull.off("screenchange", screenchange);
});
</script>
<style lang="less" scoped>
@@ -543,6 +592,7 @@
  flex-direction: column;
  .login-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4.38rem;
    background-color: #006eff;