From 3ad537052477fe31f45bd2e16045d58b35713bdc Mon Sep 17 00:00:00 2001 From: baoshiwei <baoshiwei@shlanbao.cn> Date: 星期六, 24 五月 2025 09:19:59 +0800 Subject: [PATCH] refactor(env): 更新环境配置并优化代码 --- zhitan-vue/src/views/login.vue | 79 +++++++++++++++++++++++++-------------- 1 files changed, 50 insertions(+), 29 deletions(-) diff --git a/zhitan-vue/src/views/login.vue b/zhitan-vue/src/views/login.vue index 3e8b868..194e751 100644 --- a/zhitan-vue/src/views/login.vue +++ b/zhitan-vue/src/views/login.vue @@ -11,8 +11,8 @@ <div class="middle-view"> <div class="left-wrapper"> <div class="login-font">{{ systemInfo.systemName || "" }}</div> - <img src="@/assets/images/font01.png" alt="" style="width: 406px" /> - <img src="@/assets/images/img_logo.png" alt="" style="width: 200px; margin-top: 20px" /> + <img src="@/assets/images/font01.png" alt="" style="width: 380px" /> + <img src="@/assets/images/img_logo.png" alt="" style="width: 180px; margin-top: 20px" /> </div> <div class="right-wrapper"> <div class="header"> @@ -44,7 +44,7 @@ size="large" auto-complete="off" placeholder="楠岃瘉鐮�" - style="width: 266px" + style="width: 230px" @keyup.enter="handleLogin" > <!-- <template #prefix><svg-icon icon-class="validCode" class="el-input__icon input-icon" /></template> --> @@ -83,10 +83,11 @@ </template> <script setup> -import { getCodeImg } from "@/api/login" +import { getCodeImg, authBinding } from "@/api/login" import Cookies from "js-cookie" import { encrypt, decrypt } from "@/utils/jsencrypt" import useUserStore from "@/store/modules/user" +import {ElMessage} from "element-plus"; const userStore = useUserStore() const route = useRoute() @@ -125,13 +126,13 @@ const register = ref(false) const redirect = ref(undefined) -watch( - route, - (newRoute) => { - redirect.value = newRoute.query && newRoute.query.redirect - }, - { immediate: true } -) +// watch( +// route, +// (newRoute) => { +// redirect.value = newRoute.query && newRoute.query.redirect +// }, +// { immediate: true } +// ) function handleLogin() { proxy.$refs.loginRef.validate((valid) => { @@ -193,15 +194,34 @@ } } -getCode() -getCookie() +/** + * 绗笁鏂圭櫥褰� + * @param type + */ +const doSocialLogin = () => { + console.log("doSocialLogin") + authBinding().then((res) => { + console.log(res); + if (res.code === 200) { + // 鑾峰彇鎺堟潈鍦板潃璺宠浆 + window.location.href = res.data; + } else { + ElMessage.error(res.msg); + } + }); +}; +// 闈炲崟鐐圭櫥褰曟斁寮�涓嬭竟涓よ锛屽惁鍒欐敞閲婃帀 +// getCode() +// getCookie() +// 鍗曠偣鐧诲綍鏀惧紑涓嬭竟涓�琛岋紝鍚﹀垯娉ㄩ噴鎺� +doSocialLogin() </script> <style lang="scss" scoped> .login { display: flex; align-items: center; - height: 100%; + height: 100vh; background-image: url("@/assets/images/login-background.png"); background-repeat: no-repeat; background-size: cover; @@ -209,6 +229,7 @@ position: relative; min-width: 700px; min-height: 700px; + background-color:#001146 } .middle-view { @@ -223,31 +244,31 @@ flex-direction: column; } .login-font { - font-size: 34px; + font-size: 32px; font-weight: 700; color: #d5f8ff; - margin-bottom: 12px; + margin-bottom: 10px; } } .right-wrapper { border-radius: 23px; background: #ffffff; - width: 480px; + width: 410px; position: relative; .header { - height: 70px; - line-height: 70px; + height: 56px; + line-height: 56px; border-bottom: 1px solid #f1f1f1; color: #3b3b3b; - font-size: 22px; + font-size: 18px; margin-bottom: 22px; span { display: inline-block; - height: 70px; - line-height: 70px; - border-bottom: 6px solid #3a83fc; - margin-left: 50px; + height: 56px; + line-height: 62px; + border-bottom: 4px solid #3a83fc; + margin-left: 32px; } } } @@ -277,14 +298,14 @@ } .login-form { - padding: 0 50px 30px; + padding: 0 32px 20px; .submit-btn { - width: 382px; - height: 54px; + width: 360px; + height: 44px; background: #3a83fc; border-radius: 3px; - font-size: 20px; + font-size: 18px; box-shadow: 1px 2px 5px #3a83fc; border: none; border-radius: 6px; @@ -342,7 +363,7 @@ text-align: center; color: #fff; font-family: Arial; - font-size: 16px; + font-size: 14px; letter-spacing: 1px; } </style> -- Gitblit v1.9.3