feat:更新代码
This commit is contained in:
@@ -46,8 +46,19 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item prop="password">
|
<el-form-item prop="password">
|
||||||
<el-input v-model="loginForm.password" type="password" placeholder="请输入密码" size="large"
|
<el-input
|
||||||
@keyup.enter="handleLogin" />
|
v-model="loginForm.password"
|
||||||
|
:type="showPassword ? 'text' : 'password'"
|
||||||
|
placeholder="请输入密码"
|
||||||
|
size="large"
|
||||||
|
@keyup.enter="handleLogin"
|
||||||
|
>
|
||||||
|
<template #suffix>
|
||||||
|
<el-icon class="password-eye" @click="togglePasswordVisibility">
|
||||||
|
<component :is="showPassword ? View : Hide" />
|
||||||
|
</el-icon>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@@ -74,6 +85,7 @@ import { useUserStore } from '@/stores/modules/user.js'
|
|||||||
import { watch, ref, getCurrentInstance, onMounted } from 'vue'
|
import { watch, ref, getCurrentInstance, onMounted } from 'vue'
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import { ElNotification, ElMessage } from 'element-plus'
|
import { ElNotification, ElMessage } from 'element-plus'
|
||||||
|
import { View, Hide } from '@element-plus/icons-vue'
|
||||||
import CryptoJS from 'crypto-js';
|
import CryptoJS from 'crypto-js';
|
||||||
import { useMeterStore } from '@/stores/modules/meter'
|
import { useMeterStore } from '@/stores/modules/meter'
|
||||||
|
|
||||||
@@ -105,6 +117,14 @@ const loginRules = {
|
|||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
|
// 密码显示状态
|
||||||
|
const showPassword = ref(false)
|
||||||
|
|
||||||
|
// 切换密码可见性
|
||||||
|
function togglePasswordVisibility() {
|
||||||
|
showPassword.value = !showPassword.value
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function handleLogin() {
|
function handleLogin() {
|
||||||
proxy.$refs.loginRef.validate((valid) => {
|
proxy.$refs.loginRef.validate((valid) => {
|
||||||
@@ -372,6 +392,17 @@ onMounted(async () => {
|
|||||||
height: 44px;
|
height: 44px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 密码查看图标样式 */
|
||||||
|
.password-eye {
|
||||||
|
cursor: pointer;
|
||||||
|
color: #909399;
|
||||||
|
transition: color 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.password-eye:hover {
|
||||||
|
color: #409EFF;
|
||||||
|
}
|
||||||
|
|
||||||
/* 登录按钮 */
|
/* 登录按钮 */
|
||||||
|
|
||||||
.login-button {
|
.login-button {
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ export default defineConfig(({ mode, command }) => {
|
|||||||
const { VITE_BASE_PATH } = env;
|
const { VITE_BASE_PATH } = env;
|
||||||
return {
|
return {
|
||||||
//生产环境使用相对路径,开发环境用 /
|
//生产环境使用相对路径,开发环境用 /
|
||||||
base: command === 'build' ? './' : '/',
|
// base: command === 'build' ? './' : '/',
|
||||||
|
base: '/admin/',
|
||||||
build: {
|
build: {
|
||||||
outDir: 'xSynergy-manage',
|
outDir: 'xSynergy-manage',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,14 +3,9 @@ import vue from "@vitejs/plugin-vue";
|
|||||||
import createAutoImport from "./auto-import";
|
import createAutoImport from "./auto-import";
|
||||||
import createSvgIcon from "./svg-icon";
|
import createSvgIcon from "./svg-icon";
|
||||||
import createCompression from "./compression";
|
import createCompression from "./compression";
|
||||||
import createSetupExtend from "./setup-extend";
|
import createSetupExtend from "./setup-extend";
|
||||||
import { codeInspectorPlugin } from 'code-inspector-plugin'
|
|
||||||
export default function createVitePlugins(viteEnv, isBuild = false) {
|
export default function createVitePlugins(viteEnv, isBuild = false) {
|
||||||
const vitePlugins = [vue()];
|
const vitePlugins = [vue()];
|
||||||
vitePlugins.push(codeInspectorPlugin({
|
|
||||||
bundler: 'vite',
|
|
||||||
showSwitch: true,
|
|
||||||
}))
|
|
||||||
vitePlugins.push(createAutoImport());
|
vitePlugins.push(createAutoImport());
|
||||||
vitePlugins.push(createSetupExtend());
|
vitePlugins.push(createSetupExtend());
|
||||||
vitePlugins.push(createSvgIcon(isBuild));
|
vitePlugins.push(createSvgIcon(isBuild));
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user