소스 검색

前端框架调整

zuohuaijun 4 년 전
부모
커밋
5458317945

BIN
vue-next-admin/src/assets/login-icon-two.svg


BIN
vue-next-admin/src/assets/login-icon-two1.svg


BIN
vue-next-admin/src/assets/login-icon-two2.svg


+ 1 - 1
vue-next-admin/src/i18n/pages/login/zh-cn.ts

@@ -19,7 +19,7 @@ export default {
 		placeholder2: '请输入验证码',
 		codeText: '获取验证码',
 		btnText: '登 录',
-		msgText: '* 温馨提示:建议使用谷歌、Microsoft Edge,版本 79.0.1072.62 及以上浏览器,360浏览器请使用极速模式',
+		msgText: '温馨提示:建议使用谷歌、火狐、Edge浏览器,360请使用极速模式',
 	},
 	scan: {
 		text: '打开手机扫一扫,快速登录/注册',

+ 26 - 16
vue-next-admin/src/layout/navBars/breadcrumb/user.vue

@@ -6,15 +6,19 @@
 			</div>
 			<template #dropdown>
 				<el-dropdown-menu>
-					<el-dropdown-item command="large" :disabled="disabledSize === 'large'">{{ $t('message.user.dropdownLarge') }}</el-dropdown-item>
-					<el-dropdown-item command="default" :disabled="disabledSize === 'default'">{{ $t('message.user.dropdownDefault') }}</el-dropdown-item>
-					<el-dropdown-item command="small" :disabled="disabledSize === 'small'">{{ $t('message.user.dropdownSmall') }}</el-dropdown-item>
+					<el-dropdown-item command="large" :disabled="disabledSize === 'large'">{{
+					$t('message.user.dropdownLarge') }}</el-dropdown-item>
+					<el-dropdown-item command="default" :disabled="disabledSize === 'default'">{{
+					$t('message.user.dropdownDefault') }}</el-dropdown-item>
+					<el-dropdown-item command="small" :disabled="disabledSize === 'small'">{{
+					$t('message.user.dropdownSmall') }}</el-dropdown-item>
 				</el-dropdown-menu>
 			</template>
 		</el-dropdown>
 		<el-dropdown :show-timeout="70" :hide-timeout="50" trigger="click" @command="onLanguageChange">
 			<div class="layout-navbars-breadcrumb-user-icon">
-				<i class="iconfont" :class="disabledI18n === 'en' ? 'icon-fuhao-yingwen' : 'icon-fuhao-zhongwen'" :title="$t('message.user.title1')"></i>
+				<i class="iconfont" :class="disabledI18n === 'en' ? 'icon-fuhao-yingwen' : 'icon-fuhao-zhongwen'"
+					:title="$t('message.user.title1')"></i>
 			</div>
 			<template #dropdown>
 				<el-dropdown-menu>
@@ -47,11 +51,8 @@
 			</el-popover>
 		</div>
 		<div class="layout-navbars-breadcrumb-user-icon mr10" @click="onScreenfullClick">
-			<i
-				class="iconfont"
-				:title="isScreenfull ? $t('message.user.title6') : $t('message.user.title5')"
-				:class="!isScreenfull ? 'icon-fullscreen' : 'icon-tuichuquanping'"
-			></i>
+			<i class="iconfont" :title="isScreenfull ? $t('message.user.title6') : $t('message.user.title5')"
+				:class="!isScreenfull ? 'icon-fullscreen' : 'icon-tuichuquanping'"></i>
 		</div>
 		<el-dropdown :show-timeout="70" :hide-timeout="50" @command="onHandleCommandClick">
 			<span class="layout-navbars-breadcrumb-user-link">
@@ -63,11 +64,11 @@
 			</span>
 			<template #dropdown>
 				<el-dropdown-menu>
-					<el-dropdown-item command="/home">{{ $t('message.user.dropdown1') }}</el-dropdown-item>
-					<el-dropdown-item command="wareHouse">{{ $t('message.user.dropdown6') }}</el-dropdown-item>
+					<!-- <el-dropdown-item command="/dashboard/workbench">{{ $t('message.user.dropdown1') }}</el-dropdown-item> -->
+					<!-- <el-dropdown-item command="wareHouse">{{ $t('message.user.dropdown6') }}</el-dropdown-item> -->
 					<el-dropdown-item command="/personal">{{ $t('message.user.dropdown2') }}</el-dropdown-item>
-					<el-dropdown-item command="/404">{{ $t('message.user.dropdown3') }}</el-dropdown-item>
-					<el-dropdown-item command="/401">{{ $t('message.user.dropdown4') }}</el-dropdown-item>
+					<!-- <el-dropdown-item command="/404">{{ $t('message.user.dropdown3') }}</el-dropdown-item>
+					<el-dropdown-item command="/401">{{ $t('message.user.dropdown4') }}</el-dropdown-item> -->
 					<el-dropdown-item divided command="logOut">{{ $t('message.user.dropdown5') }}</el-dropdown-item>
 				</el-dropdown-menu>
 			</template>
@@ -140,6 +141,7 @@ export default defineComponent({
 					closeOnPressEscape: false,
 					title: t('message.user.logOutTitle'),
 					message: t('message.user.logOutMessage'),
+					type: 'warning',
 					showCancelButton: true,
 					confirmButtonText: t('message.user.logOutConfirm'),
 					cancelButtonText: t('message.user.logOutCancel'),
@@ -153,7 +155,7 @@ export default defineComponent({
 								setTimeout(() => {
 									instance.confirmButtonLoading = false;
 								}, 300);
-							}, 700);
+							}, 500);
 						} else {
 							done();
 						}
@@ -165,7 +167,7 @@ export default defineComponent({
 						// 使用 reload 时,不需要调用 resetRoute() 重置路由
 						window.location.reload();
 					})
-					.catch(() => {});
+					.catch(() => { });
 			} else if (path === 'wareHouse') {
 				window.open('https://gitee.com/lyt-top/vue-next-admin');
 			} else {
@@ -195,7 +197,7 @@ export default defineComponent({
 		};
 		// 设置 element plus 组件的国际化
 		const setI18nConfig = (locale: string) => {
-			proxy.mittBus.emit('getI18nConfig',proxy.i18n.global.messages.value[locale]);			
+			proxy.mittBus.emit('getI18nConfig', proxy.i18n.global.messages.value[locale]);
 		};
 		// 初始化言语国际化
 		const initI18n = () => {
@@ -256,17 +258,20 @@ export default defineComponent({
 	display: flex;
 	align-items: center;
 	justify-content: flex-end;
+
 	&-link {
 		height: 100%;
 		display: flex;
 		align-items: center;
 		white-space: nowrap;
+
 		&-photo {
 			width: 25px;
 			height: 25px;
 			border-radius: 100%;
 		}
 	}
+
 	&-icon {
 		padding: 0 10px;
 		cursor: pointer;
@@ -275,23 +280,28 @@ export default defineComponent({
 		line-height: 50px;
 		display: flex;
 		align-items: center;
+
 		&:hover {
 			background: var(--next-color-user-hover);
+
 			i {
 				display: inline-block;
 				animation: logoAnimation 0.3s ease-in-out;
 			}
 		}
 	}
+
 	:deep(.el-dropdown) {
 		color: var(--next-bg-topBarColor);
 	}
+
 	:deep(.el-badge) {
 		height: 40px;
 		line-height: 40px;
 		display: flex;
 		align-items: center;
 	}
+
 	:deep(.el-badge__content.is-fixed) {
 		top: 12px;
 	}

+ 15 - 15
vue-next-admin/src/stores/userInfo.ts

@@ -32,21 +32,21 @@ export const useUserInfo = defineStore('userInfo', {
 		// https://gitee.com/lyt-top/vue-next-admin/issues/I5F1HP
 		async getApiUserInfo() {
 			return new Promise((resolve) => {
-				getAPI(SysAuthApi).getUserInfoGet().then((res)=>{
-					if (res.data.result == null) {
-						return;
-					}
-					var d = res.data.result;
-					const userInfos = {
-						userName: d.username,
-						photo:d.avatar,
-						time: new Date().getTime(),
-						roles: d.roles,
-						authBtnList: d.buttons
-					};
-					resolve(userInfos);
-				});
-				
+				getAPI(SysAuthApi)
+					.getUserInfoGet()
+					.then((res) => {
+						if (res.data.result == null) return;
+						var d = res.data.result;
+						const userInfos = {
+							userName: d.username,
+							photo: d.avatar ? d.avatar : '/favicon.ico',
+							time: new Date().getTime(),
+							roles: d.roles,
+							authBtnList: d.buttons,
+						};
+						resolve(userInfos);
+					});
+
 				// setTimeout(() => {
 				// 	// 模拟数据,请求接口时,记得删除多余代码及对应依赖的引入
 				// 	const userName = Cookies.get('userName');

+ 28 - 23
vue-next-admin/src/views/login/component/account.vue

@@ -1,44 +1,39 @@
 <template>
 	<el-form size="large" class="login-content-form">
 		<el-form-item class="login-animation1">
-			<el-input type="text" :placeholder="$t('message.account.accountPlaceholder1')" v-model="ruleForm.userName" clearable autocomplete="off">
+			<el-input type="text" :placeholder="$t('message.account.accountPlaceholder1')" v-model="ruleForm.userName"
+				clearable autocomplete="off">
 				<template #prefix>
-					<el-icon class="el-input__icon"><ele-User /></el-icon>
+					<el-icon class="el-input__icon">
+						<ele-User />
+					</el-icon>
 				</template>
 			</el-input>
 		</el-form-item>
 		<el-form-item class="login-animation2">
-			<el-input
-				:type="isShowPassword ? 'text' : 'password'"
-				:placeholder="$t('message.account.accountPlaceholder2')"
-				v-model="ruleForm.password"
-				autocomplete="off"
-			>
+			<el-input :type="isShowPassword ? 'text' : 'password'"
+				:placeholder="$t('message.account.accountPlaceholder2')" v-model="ruleForm.password" autocomplete="off">
 				<template #prefix>
-					<el-icon class="el-input__icon"><ele-Unlock /></el-icon>
+					<el-icon class="el-input__icon">
+						<ele-Unlock />
+					</el-icon>
 				</template>
 				<template #suffix>
-					<i
-						class="iconfont el-input__icon login-content-password"
+					<i class="iconfont el-input__icon login-content-password"
 						:class="isShowPassword ? 'icon-yincangmima' : 'icon-xianshimima'"
-						@click="isShowPassword = !isShowPassword"
-					>
+						@click="isShowPassword = !isShowPassword">
 					</i>
 				</template>
 			</el-input>
 		</el-form-item>
 		<el-form-item class="login-animation3">
 			<el-col :span="15">
-				<el-input
-					type="text"
-					maxlength="4"
-					:placeholder="$t('message.account.accountPlaceholder3')"
-					v-model="ruleForm.code"
-					clearable
-					autocomplete="off"
-				>
+				<el-input type="text" maxlength="4" :placeholder="$t('message.account.accountPlaceholder3')"
+					v-model="ruleForm.code" clearable autocomplete="off">
 					<template #prefix>
-						<el-icon class="el-input__icon"><ele-Position /></el-icon>
+						<el-icon class="el-input__icon">
+							<ele-Position />
+						</el-icon>
 					</template>
 				</el-input>
 			</el-col>
@@ -52,6 +47,7 @@
 				<span>{{ $t('message.account.accountBtnText') }}</span>
 			</el-button>
 		</el-form-item>
+		<div class="font12 mt30 login-animation4 login-msg">{{ $t('message.mobile.msgText') }}</div>
 	</el-form>
 </template>
 
@@ -101,7 +97,7 @@ export default defineComponent({
 				ElMessage.error("登录失败,请检查账号!");
 				return;
 			}
-			
+
 			state.loading.signIn = true;
 			// 存储 token 到浏览器缓存
 			Session.set('token', res.data.result?.token);
@@ -152,6 +148,7 @@ export default defineComponent({
 <style scoped lang="scss">
 .login-content-form {
 	margin-top: 20px;
+
 	@for $i from 1 through 4 {
 		.login-animation#{$i} {
 			opacity: 0;
@@ -161,25 +158,33 @@ export default defineComponent({
 			animation-delay: calc($i/10) + s;
 		}
 	}
+
 	.login-content-password {
 		display: inline-block;
 		width: 20px;
 		cursor: pointer;
+
 		&:hover {
 			color: #909399;
 		}
 	}
+
 	.login-content-code {
 		width: 100%;
 		padding: 0;
 		font-weight: bold;
 		letter-spacing: 5px;
 	}
+
 	.login-content-submit {
 		width: 100%;
 		letter-spacing: 2px;
 		font-weight: 300;
 		margin-top: 15px;
 	}
+
+	.login-msg {
+		color: var(--el-text-color-placeholder);
+	}
 }
 </style>

+ 1 - 1
vue-next-admin/src/views/login/component/scan.vue

@@ -17,7 +17,7 @@ export default defineComponent({
 		const initQrcode = () => {
 			(qrcodeRef.value as HTMLElement).innerHTML = '';
 			new QRCode(qrcodeRef.value, {
-				text: `https://qm.qq.com/cgi-bin/qm/qr?k=RdUY97Vx0T0vZ_1OOu-X1yFNkWgDwbjC&jump_from=webapi`,
+				text: `https://gitee.com/zuohuaijun/Admin.NET`,
 				width: 260,
 				height: 260,
 				colorDark: '#000000',

+ 48 - 43
vue-next-admin/src/views/login/index.vue

@@ -3,13 +3,24 @@
 		<div class="login-icon-group">
 			<div class="login-icon-group-title">
 				<img :src="logoMini" />
-				<div class="login-icon-group-title-text font25">{{ getThemeConfig.globalViceTitle }}</div>
+				<!-- <div class="login-icon-group-title-text font25">{{ getThemeConfig.globalViceTitle }}</div> -->
 			</div>
-			<img :src="loginIconTwo" class="login-icon-group-icon" />
+			<el-carousel height="550px"
+				style="width: 100%; padding-right: 38%; top:50%; transform: translateY(-50%) translate3d(0, 0, 0);">
+				<el-carousel-item>
+					<img :src="loginIconTwo" class="login-icon-group-icon" />
+				</el-carousel-item>
+				<el-carousel-item>
+					<img :src="loginIconTwo1" class="login-icon-group-icon" />
+				</el-carousel-item>
+				<el-carousel-item>
+					<img :src="loginIconTwo2" class="login-icon-group-icon" />
+				</el-carousel-item>
+			</el-carousel>
 		</div>
 		<div class="login-content">
 			<div class="login-content-main">
-				<h4 class="login-content-title ml15">{{ getThemeConfig.globalTitle }}后台模板</h4>
+				<h4 class="login-content-title">{{ getThemeConfig.globalTitle }}</h4>
 				<div v-if="!isScan">
 					<el-tabs v-model="tabsActiveName">
 						<el-tab-pane :label="$t('message.label.one1')" name="account">
@@ -36,6 +47,8 @@ import { storeToRefs } from 'pinia';
 import { useThemeConfig } from '/@/stores/themeConfig';
 import logoMini from '/@/assets/logo-mini.svg';
 import loginIconTwo from '/@/assets/login-icon-two.svg';
+import loginIconTwo1 from '/@/assets/login-icon-two1.svg';
+import loginIconTwo2 from '/@/assets/login-icon-two2.svg';
 import { NextLoading } from '/@/utils/loading';
 import Account from '/@/views/login/component/account.vue';
 import Mobile from '/@/views/login/component/mobile.vue';
@@ -68,6 +81,8 @@ export default defineComponent({
 		return {
 			logoMini,
 			loginIconTwo,
+			loginIconTwo1,
+			loginIconTwo2,
 			getThemeConfig,
 			...toRefs(state),
 		};
@@ -81,85 +96,72 @@ export default defineComponent({
 	height: 100%;
 	position: relative;
 	background: var(--el-color-white);
+
 	.login-icon-group {
 		width: 100%;
 		height: 100%;
 		position: relative;
+
 		.login-icon-group-title {
 			position: absolute;
 			top: 50px;
 			left: 80px;
 			display: flex;
 			align-items: center;
+
 			img {
-				width: 30px;
-				height: 30px;
+				width: 64px;
+				height: 64px;
 			}
-			&-text {
-				padding-left: 15px;
-				color: var(--el-color-primary);
-			}
-		}
-		&::before {
-			content: '';
-			position: absolute;
-			bottom: 0;
-			left: 0;
-			width: 60%;
-			overflow: hidden;
-			height: 80%;
-			-webkit-mask-box-image: url("data:image/svg+xml,%3Csvg width='1200' height='770' xmlns='http://www.w3.org/2000/svg' fill='none'%3E%3Cg%3E%3Cpath id='svg_1' d='M58.4 47.77C104.6 59.51 135.26 67.37 162.11 78.04C188.97 88.72 226.33 102.69 265.92 123.55C305.51 144.4 366.96 167.09 441.43 121.52C515.9 75.95 546.48 61.01 577.69 46.27C608.9 31.53 625.86 23.69 680.26 12.28C734.65 0.87 837.29 10.7 867.29 21.8C897.29 32.9 935.51 51.9 962.21 95.45C988.9 139.01 972.91 177.36 951.37 221.39C929.83 265.43 883.49 306 890.44 337.33C897.4 368.66 974.73 412.18 974.73 411.47C974.73 412.18 1066.36 457.62 1106.36 491.06C1146.36 524.5 1178.8 563.36 1184.03 579.63C1189.26 595.9 1200.4 622.49 1181.55 676.88C1162.71 731.26 1127.16 764.32 1115.31 778.64C1103.45 792.96 5.34 783.61 4.32 784.63C3.3 785.65 -172.34 2.38 1.13 35.04L58.4 47.77L58.4 47.77Z' fill='%23409eff'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
-			background: var(--el-color-primary-light-5);
-			transition: all 0.3s ease;
-		}
-		&::after {
-			content: '';
-			width: 150px;
-			height: 300px;
-			position: absolute;
-			right: 0;
-			top: 0;
-			-webkit-mask-box-image: url("data:image/svg+xml,%3Csvg width='150' height='300' xmlns='http://www.w3.org/2000/svg' fill='none'%3E%3Cg%3E%3Cpath id='svg_1' d='M-0.56 -0.28C41.94 36.17 67.73 18.94 93.33 33.96C118.93 48.98 107.58 73.56 101.94 89.76C96.29 105.96 50.09 217.83 47.87 231.18C45.64 244.52 46.02 255.2 64.4 270.05C82.79 284.91 121.99 292.31 111.98 289.81C101.97 287.32 153.96 301.48 151.83 299.9C149.69 298.32 149.98 -1.36 149.71 -1.18C149.98 -1.36 -43.06 -36.74 -0.56 -0.28L-0.56 -0.28Z' fill='%23409eff'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
-			background: var(--el-color-primary-light-5);
-			transition: all 0.3s ease;
+
+			// &-text {
+			// 	padding-left: 15px;
+			// 	color: var(--el-color-primary);
+			// }
 		}
+
 		&-icon {
-			width: 60%;
-			height: 70%;
+			width: 85%;
+			height: 85%;
 			position: absolute;
-			left: 0;
-			bottom: 0;
+			left: 10%;
+			top: 50%;
+			transform: translateY(-50%) translate3d(0, 0, 0);
 		}
 	}
+
 	.login-content {
 		width: 500px;
+		height: 500px;
 		padding: 20px;
 		position: absolute;
-		right: 200px;
+		right: 10%;
 		top: 50%;
 		transform: translateY(-50%) translate3d(0, 0, 0);
 		background-color: var(--el-color-white);
-		border: 5px solid var(--el-color-primary-light-8);
+		border: 1px solid var(--el-color-primary-light-8);
 		border-radius: 5px;
 		overflow: hidden;
 		z-index: 1;
-		height: 460px;
+
 		.login-content-main {
 			margin: 0 auto;
 			width: 80%;
+
 			.login-content-title {
 				color: var(--el-text-color-primary);
-				font-weight: 500;
-				font-size: 22px;
+				font-weight: 800;
+				font-size: 32px;
 				text-align: center;
-				letter-spacing: 4px;
-				margin: 15px 0 30px;
+				//letter-spacing: 4px;
+				margin: 5px 0 30px;
 				white-space: nowrap;
 				z-index: 5;
 				position: relative;
 				transition: all 0.3s ease;
 			}
 		}
+
 		.login-content-main-sacn {
 			position: absolute;
 			top: 0;
@@ -170,6 +172,7 @@ export default defineComponent({
 			cursor: pointer;
 			transition: all ease 0.3s;
 			color: var(--el-text-color-primary);
+
 			&-delta {
 				position: absolute;
 				width: 35px;
@@ -180,11 +183,13 @@ export default defineComponent({
 				background: var(--el-color-white);
 				transform: rotate(-45deg);
 			}
+
 			&:hover {
 				opacity: 1;
 				transition: all ease 0.3s;
 				color: var(--el-color-primary) !important;
 			}
+
 			i {
 				width: 47px;
 				height: 50px;