From ddbf9504fc5faf6764fffa4e9263a3ad927331d8 Mon Sep 17 00:00:00 2001 From: zhangwei <1504152376@qq.com> Date: 星期一, 14 七月 2025 17:14:26 +0800 Subject: [PATCH] '-' --- src/views/login/index.vue | 88 ++++++++++++++++++++++++++++++++++++-------- 1 files changed, 72 insertions(+), 16 deletions(-) diff --git a/src/views/login/index.vue b/src/views/login/index.vue index a9ca3a2..aebcc27 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -110,7 +110,8 @@ hideTenantForLogin: false, expirySeconds: 60, // 楠岃瘉鐮佽繃鏈熸椂闂� phoneSeconds: 0, // 鎵嬫満楠岃瘉鐮佸�掕鏃� - roleList: [] + roleList: [], + nowRole: {} }); // 楠岃瘉鐮佽繃鏈熻鏃跺櫒 let timer: any = null; @@ -119,7 +120,7 @@ // 椤甸潰鍒濆鍖� onMounted(async () => { // 鑻RL甯︽湁Token鍙傛暟锛堢涓夋柟鐧诲綍锛� - const accessToken = route.query.token; + // if (accessToken) await saveTokenAndInitRoutes(accessToken); // watch( // () => themeConfig.value.isLoaded, @@ -134,6 +135,13 @@ getCaptcha(); exRole().then(res => { state.roleList = res.result; + const role = route.query; + if (role.code) { + state.nowRole = role; + } else { + state.nowRole = state.roleList[0]; + } + state.ruleForm.exRoleCode = state.nowRole?.code; }); // 娉ㄥ唽楠岃瘉鐮佽繃鏈熻鏃跺櫒 // if (state.captchaEnabled) { @@ -170,13 +178,21 @@ if (res.code == 200) { // 鑾峰彇鍚庣璺敱 return initRouter().then(() => { - disabled.value = true; - router - .replace("index") - .then(() => { - message("鐧诲綍鎴愬姛", { type: "success" }); - }) - .finally(() => (disabled.value = false)); + console.log(res, "=-=-=-="); + if (!res.result.exRoles.hasFlsh) { + disabled.value = true; + router + .replace({ + name: "RegisterNav", + query: { code: res?.result?.exRoles.code } + }) + .then(() => { + message("鐧诲綍鎴愬姛", { type: "success" }); + }) + .finally(() => (disabled.value = false)); + } else { + router.replace("welcome"); + } }); } else { message(res?.message || "鐧诲綍澶辫触", { type: "error" }); @@ -224,16 +240,16 @@ <img width="400px" :src="logo1" class="logo1" /> </div> <!-- <img :src="bg" class="wave" /> --> - <div class="flex-c absolute right-5 top-3"> - <!-- 涓婚 --> - <el-switch + <!-- <div class="flex-c absolute right-5 top-3"> --> + <!-- 涓婚 --> + <!-- <el-switch v-model="dataTheme" inline-prompt :active-icon="dayIcon" :inactive-icon="darkIcon" @change="dataThemeChange" /> - </div> + </div> --> <div class="login-container"> <div class="img"> <!-- <component :is="toRaw(illustration)" /> --> @@ -242,7 +258,7 @@ <div class="login-form"> <!-- <avatar class="avatar" /> --> <Motion> - <h2 class="outline-hidden">{{ title }}</h2> + <h2 class="logintitle">{{ state.nowRole.name }}鐧诲綍</h2> </Motion> <el-form @@ -251,7 +267,7 @@ :rules="loginRules" size="large" > - <Motion :delay="150"> + <!-- <Motion :delay="150"> <el-form-item prop="exRoleCode"> <el-radio-group v-model="state.ruleForm.exRoleCode"> <el-radio @@ -262,7 +278,7 @@ > </el-radio-group> </el-form-item> - </Motion> + </Motion> --> <Motion :delay="100"> <el-form-item :rules="[ @@ -382,4 +398,44 @@ #suffix-span { cursor: pointer; } +.login-content-code { + display: flex; + align-items: center; + justify-content: space-around; + position: relative; + + .login-content-code-img { + width: 100%; + height: 40px; + line-height: 40px; + background-color: #ffffff; + // /* border: 1px solid rgb(220, 223, 230); */ + cursor: pointer; + transition: all ease 0.2s; + border-radius: 4px; + user-select: none; + + &:hover { + border-color: #c0c4cc; + transition: all ease 0.2s; + } + } +} + +.login-content-code-expired { + @extend .login-content-code; + &::before { + content: "楠岃瘉鐮佸凡杩囨湡"; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + border-radius: 4px; + background-color: rgba(0, 0, 0, 0.5); + color: #ffffff; + text-align: center; + line-height: 40px; + } +} </style> -- Gitblit v1.9.1