😎1、登陆页面增加多语言选择 2、升级依赖
This commit is contained in:
parent
128d774310
commit
be0e711b8c
@ -28,9 +28,9 @@
|
||||
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
|
||||
<PackageReference Include="BouncyCastle.Cryptography" Version="2.5.1" Aliases="BouncyCastleV2" />
|
||||
<PackageReference Include="Elastic.Clients.Elasticsearch" Version="8.17.3" />
|
||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.7.31" />
|
||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.7.31" />
|
||||
<PackageReference Include="Furion.Pure" Version="4.9.7.31" />
|
||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.7.32" />
|
||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.7.32" />
|
||||
<PackageReference Include="Furion.Pure" Version="4.9.7.32" />
|
||||
<PackageReference Include="Hardware.Info" Version="101.0.1" />
|
||||
<PackageReference Include="Hashids.net" Version="1.7.0" />
|
||||
<PackageReference Include="IPTools.China" Version="1.6.0" />
|
||||
@ -56,7 +56,7 @@
|
||||
<PackageReference Include="SSH.NET" Version="2024.2.0" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.6.0.2" />
|
||||
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
||||
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1205" />
|
||||
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1206" />
|
||||
<PackageReference Include="UAParser" Version="3.1.47" />
|
||||
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
|
||||
</ItemGroup>
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DocumentFormat.OpenXml" Version="3.3.0" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.13.0" />
|
||||
<PackageReference Include="Rezero.Api" Version="1.8.2" />
|
||||
<PackageReference Include="Rezero.Api" Version="1.8.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"name": "admin.net.pro",
|
||||
"type": "module",
|
||||
"version": "2.4.33",
|
||||
"lastBuildTime": "2025.03.23",
|
||||
"lastBuildTime": "2025.03.24",
|
||||
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
|
||||
"author": "zuohuaijun",
|
||||
"license": "MIT",
|
||||
@ -77,8 +77,8 @@
|
||||
"vue-signature-pad": "^3.0.2",
|
||||
"vue3-flag-icons": "^0.0.3",
|
||||
"vue3-tree-org": "^4.2.2",
|
||||
"vxe-pc-ui": "^4.4.22",
|
||||
"vxe-table": "^4.11.28",
|
||||
"vxe-pc-ui": "^4.4.23",
|
||||
"vxe-table": "^4.11.29",
|
||||
"vxe-table-plugin-element": "^4.0.4",
|
||||
"vxe-table-plugin-export-xlsx": "^4.0.7",
|
||||
"xe-utils": "^3.7.4",
|
||||
@ -101,7 +101,7 @@
|
||||
"eslint-plugin-vue": "^10.0.0",
|
||||
"globals": "^16.0.0",
|
||||
"less": "^4.2.2",
|
||||
"openapi-ts-request": "^1.2.0",
|
||||
"openapi-ts-request": "^1.3.0",
|
||||
"prettier": "^3.5.3",
|
||||
"rollup-plugin-visualizer": "^5.14.0",
|
||||
"sass": "^1.86.0",
|
||||
|
||||
@ -31,8 +31,7 @@ export default {
|
||||
btnText: 'Sign in',
|
||||
loginfail: 'Login failed, please check your account!',
|
||||
retry: '{duration} seconds after the code is requested again',
|
||||
msgText:
|
||||
'Warm tip: it is recommended to use Google, Microsoft edge, version 79.0.1072.62 and above browsers, and 360 browser, please use speed mode',
|
||||
msgText: 'Warm tip: it is recommended to use Google, Microsoft edge, version 79.0.1072.62 and above browsers, and 360 browser, please use speed mode',
|
||||
},
|
||||
scan: {
|
||||
text: 'Open the mobile phone to scan and quickly log in / register',
|
||||
@ -40,5 +39,6 @@ export default {
|
||||
signInText: 'welcome back!',
|
||||
email: {
|
||||
emailPlaceholder: 'Please enter the email',
|
||||
}
|
||||
},
|
||||
viceDesc: 'Standing on the shoulders of giants NET Universal Permission Development Framework',
|
||||
};
|
||||
|
||||
@ -39,5 +39,6 @@ export default {
|
||||
signInText: '欢迎回来!',
|
||||
email: {
|
||||
emailPlaceholder: '请输入邮箱',
|
||||
}
|
||||
},
|
||||
viceDesc: '站在巨人肩膀上的 .NET 通用权限开发框架',
|
||||
};
|
||||
|
||||
@ -148,7 +148,6 @@ const state = reactive({
|
||||
tagsViewList: [],
|
||||
tagsViewRoutesList: [],
|
||||
});
|
||||
const emit = defineEmits(['currentContextmenuClick']);
|
||||
// 设置分割样式
|
||||
const layoutUserFlexNum = computed(() => {
|
||||
let num: string | number = '';
|
||||
@ -250,12 +249,8 @@ const onLanguageChange = (lang: string) => {
|
||||
other.useTitle();
|
||||
initI18nOrSize('globalI18n', 'disabledI18n');
|
||||
// window.location.reload();
|
||||
// 关闭全部tabpage.
|
||||
closeAllTagsView();
|
||||
};
|
||||
|
||||
const closeAllTagsView = () => {
|
||||
|
||||
// 关闭全部标签页
|
||||
// mittBus.emit('onCurrentContextmenuClick', { contextMenuClickId: 3 });
|
||||
};
|
||||
|
||||
// 初始化组件大小/i18n
|
||||
|
||||
@ -67,30 +67,6 @@
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<div class="font12 mt30 login-animation4 login-msg">{{ $t('message.mobile.msgText') }}</div>
|
||||
<div class="change-language">
|
||||
<div class="change-language-title">{{ $t('message.account.changeLanguage') }}:</div>
|
||||
<div style="cursor: pointer">
|
||||
<el-dropdown size="small" :show-timeout="70" :hide-timeout="50" trigger="click" @command="onLanguageChange" placement="top-end">
|
||||
<div class="layout-navbars-breadcrumb-user-icon" style="margin-left: 5px">
|
||||
<FlagIcon :code="currentCountryCode" :size="18" :title="$t('message.user.title1')" />
|
||||
</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item v-for="(value, key) in languageList" :key="key" :command="key" :disabled="state.disabledI18n === key">
|
||||
<div class="flex items-center">
|
||||
<div class="mr-2">
|
||||
<FlagIcon :code="getCountryCode(key)" :size="18" />
|
||||
</div>
|
||||
<div style="margin-left: 10px">
|
||||
{{ value }}
|
||||
</div>
|
||||
</div>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <el-button type="primary" round v-waves @click="weixinSignIn" :loading="state.loading.signIn"></el-button> -->
|
||||
</el-form>
|
||||
</el-tooltip>
|
||||
@ -126,9 +102,6 @@ import { storeToRefs } from 'pinia';
|
||||
|
||||
import { accessTokenKey, clearTokens, feature, getAPI } from '/@/utils/axios-utils';
|
||||
import { SysAuthApi } from '/@/api-services/api';
|
||||
import { languageList, getCountryCode } from '/@/i18n';
|
||||
import FlagIcon from 'vue3-flag-icons';
|
||||
import type { CountryCode } from 'vue3-flag-icons';
|
||||
|
||||
// 旋转图片滑块组件
|
||||
// import verifyImg from '/@/assets/logo-mini.svg';
|
||||
@ -152,7 +125,6 @@ const loginFail = t('message.account.loginfail');
|
||||
const notPrivilege = t('message.account.notprivilege');
|
||||
|
||||
const dragRef: any = ref(null);
|
||||
const currentCountryCode = ref<CountryCode>(getCountryCode(themeConfig.value.globalI18n));
|
||||
const state = reactive({
|
||||
isShowPassword: false,
|
||||
ruleForm: {
|
||||
@ -178,23 +150,8 @@ const state = reactive({
|
||||
isPassRotate: false,
|
||||
capsLockVisible: false,
|
||||
expirySeconds: 60 as any, // 验证码过期时间
|
||||
disabledI18n: 'zh-CN',
|
||||
});
|
||||
|
||||
const onLanguageChange = (lang: string) => {
|
||||
Local.remove('themeConfig');
|
||||
themeConfig.value.globalI18n = lang;
|
||||
Local.set('themeConfig', themeConfig.value);
|
||||
currentCountryCode.value = getCountryCode(lang);
|
||||
locale.value = lang;
|
||||
initI18nOrSize('globalI18n', 'disabledI18n');
|
||||
};
|
||||
|
||||
// 初始化组件大小/i18n
|
||||
const initI18nOrSize = (value: string, attr: string) => {
|
||||
(<any>state)[attr] = Local.get('themeConfig')[value];
|
||||
};
|
||||
|
||||
// 验证码过期计时器
|
||||
let timer: any = null;
|
||||
|
||||
@ -473,17 +430,5 @@ defineExpose({ saveTokenAndInitRoutes });
|
||||
.login-msg {
|
||||
color: var(--el-text-color-placeholder);
|
||||
}
|
||||
.change-language {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
margin-top: 5px;
|
||||
margin-right: 20px;
|
||||
|
||||
.change-language-title {
|
||||
font-size: 12px;
|
||||
color: var(--el-text-color-placeholder);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -5,7 +5,8 @@
|
||||
<img :src="getThemeConfig.logoUrl" />
|
||||
<div class="login-left-logo-text">
|
||||
<span>{{ getThemeConfig.globalViceTitle }}</span>
|
||||
<span class="login-left-logo-text-msg">{{ getThemeConfig.globalViceTitleMsg }}</span>
|
||||
<!-- <span class="login-left-logo-text-msg">{{ getThemeConfig.globalViceTitleMsg }}</span> -->
|
||||
<span class="login-left-logo-text-msg">{{ $t('message.viceDesc') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-carousel height="500px" class="login-carousel">
|
||||
@ -45,6 +46,30 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="change-language">
|
||||
<!-- <div class="change-language-title">{{ $t('message.account.changeLanguage') }}:</div> -->
|
||||
<div style="cursor: pointer">
|
||||
<el-dropdown @command="onLanguageChange">
|
||||
<div class="layout-navbars-breadcrumb-user-icon">
|
||||
<FlagIcon :code="currentCountryCode" :size="18" :title="$t('message.user.title1')" />
|
||||
</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item v-for="(value, key) in languageList" :key="key" :command="key" :disabled="state.disabledI18n === key">
|
||||
<div class="flex items-center">
|
||||
<div class="mr-2">
|
||||
<FlagIcon :code="getCountryCode(key)" :size="18" />
|
||||
</div>
|
||||
<div style="margin-left: 10px">
|
||||
{{ value }}
|
||||
</div>
|
||||
</div>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="copyright" :class="[getThemeConfig.icp ? 'mb25' : 'mt5']">{{ getThemeConfig.copyright }}</div>
|
||||
<div v-if="getThemeConfig.icp" class="icp mt5">
|
||||
@ -54,18 +79,24 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="loginIndex">
|
||||
import { defineAsyncComponent, onMounted, reactive, computed } from 'vue';
|
||||
import { defineAsyncComponent, onMounted, reactive, computed, ref } from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useThemeConfig } from '/@/stores/themeConfig';
|
||||
import { NextLoading } from '/@/utils/loading';
|
||||
// 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 { loadSysInfo } from '/@/utils/sysInfo';
|
||||
import { Local } from '/@/utils/storage';
|
||||
// 引入多语言
|
||||
import { languageList, getCountryCode } from '/@/i18n';
|
||||
import FlagIcon from 'vue3-flag-icons';
|
||||
import type { CountryCode } from 'vue3-flag-icons';
|
||||
const { locale } = useI18n();
|
||||
|
||||
// 引入组件
|
||||
const Account = defineAsyncComponent(() => import('/@/views/login/component/account.vue'));
|
||||
@ -75,14 +106,17 @@ const Scan = defineAsyncComponent(() => import('/@/views/login/component/scan.vu
|
||||
const route = useRoute();
|
||||
const storesThemeConfig = useThemeConfig();
|
||||
const { themeConfig } = storeToRefs(storesThemeConfig);
|
||||
const currentCountryCode = ref<CountryCode>(getCountryCode(themeConfig.value.globalI18n));
|
||||
const state = reactive({
|
||||
tabsActiveName: 'account',
|
||||
isScan: false,
|
||||
disabledI18n: 'zh-CN',
|
||||
});
|
||||
// 获取布局配置信息
|
||||
const getThemeConfig = computed(() => {
|
||||
return themeConfig.value;
|
||||
});
|
||||
|
||||
// 页面加载时
|
||||
onMounted(async () => {
|
||||
// 获取租户Id标识
|
||||
@ -97,6 +131,21 @@ onMounted(async () => {
|
||||
|
||||
NextLoading.done();
|
||||
});
|
||||
|
||||
// 切换语言
|
||||
const onLanguageChange = (lang: string) => {
|
||||
Local.remove('themeConfig');
|
||||
themeConfig.value.globalI18n = lang;
|
||||
Local.set('themeConfig', themeConfig.value);
|
||||
currentCountryCode.value = getCountryCode(lang);
|
||||
locale.value = lang;
|
||||
initI18nOrSize('globalI18n', 'disabledI18n');
|
||||
};
|
||||
|
||||
// 初始化组件大小/i18n
|
||||
const initI18nOrSize = (value: string, attr: string) => {
|
||||
(<any>state)[attr] = Local.get('themeConfig')[value];
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@ -322,6 +371,18 @@ onMounted(async () => {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
// 多语言
|
||||
.change-language {
|
||||
position: relative;
|
||||
margin-top: 30px;
|
||||
margin-right: 30px;
|
||||
|
||||
// .change-language-title {
|
||||
// font-size: 12px;
|
||||
// color: var(--el-text-color-placeholder);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user