提交修改的侧边栏样式

pull/1/head
qinzhenpen 2 years ago
parent 33a9c760ac
commit 9c8b14931f

@ -1,5 +1,5 @@
# 页面标题 # 页面标题
VITE_APP_TITLE = 若依管理系统 VITE_APP_TITLE = 区块链金融
# 开发环境配置 # 开发环境配置
VITE_APP_ENV = 'development' VITE_APP_ENV = 'development'

@ -1,5 +1,5 @@
# 页面标题 # 页面标题
VITE_APP_TITLE = 若依管理系统 VITE_APP_TITLE = 区块链金融
# 生产环境配置 # 生产环境配置
VITE_APP_ENV = 'production' VITE_APP_ENV = 'production'

@ -1,5 +1,5 @@
# 页面标题 # 页面标题
VITE_APP_TITLE = 若依管理系统 VITE_APP_TITLE = 区块链金融
# 生产环境配置 # 生产环境配置
VITE_APP_ENV = 'staging' VITE_APP_ENV = 'staging'

@ -7,7 +7,7 @@
<meta name="renderer" content="webkit"> <meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="/favicon.ico"> <link rel="icon" href="/favicon.ico">
<title>若依管理系统</title> <title>区块链金融</title>
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]--> <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
<style> <style>
html, html,

@ -1,7 +1,7 @@
{ {
"name": "ruoyi", "name": "ruoyi",
"version": "3.8.6", "version": "3.8.6",
"description": "若依管理系统", "description": "区块链金融",
"author": "若依", "author": "若依",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 KiB

After

Width:  |  Height:  |  Size: 831 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 KiB

@ -15,7 +15,7 @@
-webkit-transition: width .28s; -webkit-transition: width .28s;
transition: width 0.28s; transition: width 0.28s;
width: $base-sidebar-width !important; width: $base-sidebar-width !important;
background-color: $base-menu-background; background-color: transparent !important;
height: 100%; height: 100%;
position: fixed; position: fixed;
font-size: 0px; font-size: 0px;
@ -34,6 +34,9 @@
.scrollbar-wrapper { .scrollbar-wrapper {
overflow-x: hidden !important; overflow-x: hidden !important;
padding-top: 52px;
background: url('../images/侧边栏.png') no-repeat center !important;
background-size: cover !important;
} }
.el-scrollbar__bar.is-vertical { .el-scrollbar__bar.is-vertical {
@ -68,12 +71,14 @@
border: none; border: none;
height: 100%; height: 100%;
width: 100% !important; width: 100% !important;
background-color: transparent !important;
} }
.el-menu-item, .menu-title { .el-menu-item, .menu-title {
overflow: hidden !important; overflow: hidden !important;
text-overflow: ellipsis !important; text-overflow: ellipsis !important;
white-space: nowrap !important; white-space: nowrap !important;
} }
.el-menu-item .el-menu-tooltip__trigger { .el-menu-item .el-menu-tooltip__trigger {
@ -213,7 +218,7 @@
.el-menu-item { .el-menu-item {
&:hover { &:hover {
// you can use $sub-menuHover // you can use $sub-menuHover
background-color: rgba(0, 0, 0, 0.06) !important; background-color: pink !important;
} }
} }

@ -24,6 +24,7 @@ export default defineComponent({
return { return {
iconName: computed(() => `#icon-${props.iconClass}`), iconName: computed(() => `#icon-${props.iconClass}`),
svgClass: computed(() => { svgClass: computed(() => {
if (props.className) { if (props.className) {
return `svg-icon ${props.className}` return `svg-icon ${props.className}`
} }

@ -1,29 +1,43 @@
<template> <template>
<div class="sidebar-logo-container" :class="{ 'collapse': collapse }" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }"> <div
class="sidebar-logo-container"
:class="{ collapse: collapse }"
:style="{
backgroundColor:
sideTheme === 'theme-dark'
? variables.menuBackground
: variables.menuLightBackground,
}"
>
<transition name="sidebarLogoFade"> <transition name="sidebarLogoFade">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/"> <router-link
<img v-if="logo" :src="logo" class="sidebar-logo" /> v-if="collapse"
<h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }}</h1> key="collapse"
class="sidebar-logo-link"
to="/"
>
<!-- <img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }}</h1> -->
</router-link> </router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/"> <router-link v-else key="expand" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo" /> <!-- <img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }}</h1> <h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }}</h1> -->
</router-link> </router-link>
</transition> </transition>
</div> </div>
</template> </template>
<script setup> <script setup>
import variables from '@/assets/styles/variables.module.scss' import variables from "@/assets/styles/variables.module.scss";
import logo from '@/assets/logo/logo.png' import logo from "@/assets/logo/logo.png";
import useSettingsStore from '@/store/modules/settings' import useSettingsStore from "@/store/modules/settings";
defineProps({ defineProps({
collapse: { collapse: {
type: Boolean, type: Boolean,
required: true required: true,
} },
}) });
const title = import.meta.env.VITE_APP_TITLE; const title = import.meta.env.VITE_APP_TITLE;
const settingsStore = useSettingsStore(); const settingsStore = useSettingsStore();
@ -43,8 +57,8 @@ const sideTheme = computed(() => settingsStore.sideTheme);
.sidebar-logo-container { .sidebar-logo-container {
position: relative; position: relative;
width: 100%; width: 100%;
height: 50px; // height: 50px;
line-height: 50px; // line-height: 50px;
background: #2b2f3a; background: #2b2f3a;
text-align: center; text-align: center;
overflow: hidden; overflow: hidden;

@ -1,10 +1,11 @@
<template> <template>
<div :class="classObj" class="app-wrapper" :style="{ '--current-color': theme }"> <div :class="classObj" class="app-wrapper" :style="{ '--current-color': theme }">
<div v-if="device === 'mobile' && sidebar.opened" class="drawer-bg" @click="handleClickOutside"/> <div v-if="device === 'mobile' && sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
<navbar @setLayout="setLayout" />
<sidebar v-if="!sidebar.hide" class="sidebar-container" /> <sidebar v-if="!sidebar.hide" class="sidebar-container" />
<div :class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }" class="main-container"> <div :class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }" class="main-container">
<div :class="{ 'fixed-header': fixedHeader }"> <div :class="{ 'fixed-header': fixedHeader }">
<navbar @setLayout="setLayout" />
<tags-view v-if="needTagsView" /> <tags-view v-if="needTagsView" />
</div> </div>
<app-main /> <app-main />
@ -55,7 +56,6 @@ watchEffect(() => {
function handleClickOutside() { function handleClickOutside() {
useAppStore().closeSideBar({ withoutAnimation: false }) useAppStore().closeSideBar({ withoutAnimation: false })
} }
const settingRef = ref(null); const settingRef = ref(null);
function setLayout() { function setLayout() {
settingRef.value.openSetting(); settingRef.value.openSetting();

@ -1,7 +1,13 @@
<template> <template>
<div class="login"> <div class="login">
<el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form"> <div class="login-main">
<h3 class="title">若依后台管理系统</h3> <el-form
ref="loginRef"
:model="loginForm"
:rules="loginRules"
class="login-form"
>
<h3 class="title">区块链管理系统</h3>
<el-form-item prop="username"> <el-form-item prop="username">
<el-input <el-input
v-model="loginForm.username" v-model="loginForm.username"
@ -10,7 +16,9 @@
auto-complete="off" auto-complete="off"
placeholder="账号" placeholder="账号"
> >
<template #prefix><svg-icon icon-class="user" class="el-input__icon input-icon" /></template> <template #prefix
><svg-icon icon-class="user" class="el-input__icon input-icon"
/></template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
@ -22,10 +30,14 @@
placeholder="密码" placeholder="密码"
@keyup.enter="handleLogin" @keyup.enter="handleLogin"
> >
<template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template> <template #prefix
><svg-icon
icon-class="password"
class="el-input__icon input-icon"
/></template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="code" v-if="captchaEnabled"> <!-- <el-form-item prop="code" v-if="captchaEnabled">
<el-input <el-input
v-model="loginForm.code" v-model="loginForm.code"
size="large" size="large"
@ -34,31 +46,42 @@
style="width: 63%" style="width: 63%"
@keyup.enter="handleLogin" @keyup.enter="handleLogin"
> >
<template #prefix><svg-icon icon-class="validCode" class="el-input__icon input-icon" /></template> <template #prefix
><svg-icon
icon-class="validCode"
class="el-input__icon input-icon"
/></template>
</el-input> </el-input>
<div class="login-code"> <div class="login-code">
<img :src="codeUrl" @click="getCode" class="login-code-img"/> <img :src="codeUrl" @click="getCode" class="login-code-img" />
</div> </div>
</el-form-item> </el-form-item> -->
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;"></el-checkbox> <el-checkbox
<el-form-item style="width:100%;"> v-model="loginForm.rememberMe"
style="margin: 0px 0px 25px 0px"
>记住密码</el-checkbox
>
<el-form-item style="width: 100%">
<el-button <el-button
:loading="loading" :loading="loading"
size="large" size="large"
type="primary" type="primary"
style="width:100%;" style="width: 100%"
@click.prevent="handleLogin" @click.prevent="handleLogin"
> >
<span v-if="!loading"> </span> <span v-if="!loading"> </span>
<span v-else> ...</span> <span v-else> ...</span>
</el-button> </el-button>
<div style="float: right;" v-if="register"> <div style="float: right" v-if="register">
<router-link class="link-type" :to="'/register'">立即注册</router-link> <router-link class="link-type" :to="'/register'"
>立即注册</router-link
>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div>
<!-- 底部 --> <!-- 底部 -->
<div class="el-login-footer"> <div class="el-login-footer" style="display: none;">
<span>Copyright © 2018-2023 ruoyi.vip All Rights Reserved.</span> <span>Copyright © 2018-2023 ruoyi.vip All Rights Reserved.</span>
</div> </div>
</div> </div>
@ -68,9 +91,9 @@
import { getCodeImg } from "@/api/login"; import { getCodeImg } from "@/api/login";
import Cookies from "js-cookie"; import Cookies from "js-cookie";
import { encrypt, decrypt } from "@/utils/jsencrypt"; import { encrypt, decrypt } from "@/utils/jsencrypt";
import useUserStore from '@/store/modules/user' import useUserStore from "@/store/modules/user";
const userStore = useUserStore() const userStore = useUserStore();
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
@ -80,35 +103,41 @@ const loginForm = ref({
password: "admin123", password: "admin123",
rememberMe: false, rememberMe: false,
code: "", code: "",
uuid: "" uuid: "",
}); });
const loginRules = { const loginRules = {
username: [{ required: true, trigger: "blur", message: "请输入您的账号" }], username: [{ required: true, trigger: "blur", message: "请输入您的账号" }],
password: [{ required: true, trigger: "blur", message: "请输入您的密码" }], password: [{ required: true, trigger: "blur", message: "请输入您的密码" }],
code: [{ required: true, trigger: "change", message: "请输入验证码" }]
}; };
const codeUrl = ref(""); const codeUrl = ref("");
const loading = ref(false); const loading = ref(false);
// //
const captchaEnabled = ref(true); // const captchaEnabled = ref(true);
// //
const register = ref(false); const register = ref(false);
const redirect = ref(undefined); const redirect = ref(undefined);
watch(route, (newRoute) => { watch(
route,
(newRoute) => {
redirect.value = newRoute.query && newRoute.query.redirect; redirect.value = newRoute.query && newRoute.query.redirect;
}, { immediate: true }); },
{ immediate: true }
);
function handleLogin() { function handleLogin() {
proxy.$refs.loginRef.validate(valid => { proxy.$refs.loginRef.validate((valid) => {
if (valid) { if (valid) {
loading.value = true; loading.value = true;
// cookie // cookie
if (loginForm.value.rememberMe) { if (loginForm.value.rememberMe) {
Cookies.set("username", loginForm.value.username, { expires: 30 }); Cookies.set("username", loginForm.value.username, { expires: 30 });
Cookies.set("password", encrypt(loginForm.value.password), { expires: 30 }); Cookies.set("password", encrypt(loginForm.value.password), {
expires: 30,
});
Cookies.set("rememberMe", loginForm.value.rememberMe, { expires: 30 }); Cookies.set("rememberMe", loginForm.value.rememberMe, { expires: 30 });
} else { } else {
// //
@ -117,9 +146,12 @@ function handleLogin() {
Cookies.remove("rememberMe"); Cookies.remove("rememberMe");
} }
// action // action
userStore.login(loginForm.value).then(() => { userStore
.login(loginForm.value)
.then(() => {
router.push({ path: redirect.value || "/" }); router.push({ path: redirect.value || "/" });
}).catch(() => { })
.catch(() => {
loading.value = false; loading.value = false;
// //
if (captchaEnabled.value) { if (captchaEnabled.value) {
@ -130,15 +162,16 @@ function handleLogin() {
}); });
} }
function getCode() { // function getCode() {
getCodeImg().then(res => { // getCodeImg().then((res) => {
captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled; // captchaEnabled.value =
if (captchaEnabled.value) { // res.captchaEnabled === undefined ? true : res.captchaEnabled;
codeUrl.value = "data:image/gif;base64," + res.img; // if (captchaEnabled.value) {
loginForm.value.uuid = res.uuid; // codeUrl.value = "data:image/gif;base64," + res.img;
} // loginForm.value.uuid = res.uuid;
}); // }
} // });
// }
function getCookie() { function getCookie() {
const username = Cookies.get("username"); const username = Cookies.get("username");
@ -146,16 +179,17 @@ function getCookie() {
const rememberMe = Cookies.get("rememberMe"); const rememberMe = Cookies.get("rememberMe");
loginForm.value = { loginForm.value = {
username: username === undefined ? loginForm.value.username : username, username: username === undefined ? loginForm.value.username : username,
password: password === undefined ? loginForm.value.password : decrypt(password), password:
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe) password === undefined ? loginForm.value.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
}; };
} }
getCode(); // getCode();
getCookie(); getCookie();
</script> </script>
<style lang='scss' scoped> <style lang="scss" scoped>
.login { .login {
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -167,14 +201,21 @@ getCookie();
.title { .title {
margin: 0px auto 30px auto; margin: 0px auto 30px auto;
text-align: center; text-align: center;
color: #707070; color: rgb(48, 50, 52);
font-size: 22px;
}
.login-main {
width: 81%;
height: 100%;
display: flex;
align-items: center;
justify-content: end;
} }
.login-form { .login-form {
border-radius: 6px; border-radius: 6px;
background: #ffffff; background: #ffffff;
width: 400px; width: 400px;
padding: 25px 25px 5px 25px; padding:55px 25px 33px 25px;
.el-input { .el-input {
height: 40px; height: 40px;
input { input {

Loading…
Cancel
Save