yanghao 2 月之前
父节点
当前提交
61fabf4b7d
共有 1 个文件被更改,包括 8 次插入11 次删除
  1. 8 11
      src/views/login.vue

+ 8 - 11
src/views/login.vue

@@ -21,7 +21,7 @@
         <h1 class="text-2xl font-bold text-center mb-8">登录</h1>
 
         <!-- 用户名密码登陆 -->
-        <div v-if="!showQrDialog && !showQrOnly">
+        <!-- <div>
           <el-form
             :model="form"
             :rules="rules"
@@ -62,17 +62,11 @@
               >
             </div>
           </div>
-        </div>
+        </div> -->
 
         <!-- 钉钉登陆 -->
-        <div v-show="showQrOnly" class="text-center">
+        <div class="text-center">
           <div id="login_container" class="pb-2"></div>
-
-          <div class="flex gap-3 justify-center mt-4">
-            <el-button class="w-full" @click="backToPasswordLogin"
-              >返回用户名密码登录</el-button
-            >
-          </div>
         </div>
       </div>
     </div>
@@ -80,13 +74,12 @@
 </template>
 
 <script lang="ts" setup>
-import { nextTick, reactive, ref } from "vue";
+import { nextTick, onMounted, reactive, ref } from "vue";
 import { ElMessage } from "element-plus";
 import logo from "@/assets/images/logo.png";
 import bgImage from "@/assets/images/bg.png";
 import { login } from "@/api/user";
 import * as authUtil from "@/utils/auth";
-import { encrypt } from "@/utils/jsencrypt";
 
 type LoginForm = {
   username: string;
@@ -227,6 +220,10 @@ const backToPasswordLogin = () => {
   // 移除监听事件
   window.removeEventListener("message", handleMsg());
 };
+
+onMounted(() => {
+  qrLogin();
+});
 </script>
 
 <style scoped>