|
@@ -1,5 +1,16 @@
|
|
|
<template>
|
|
|
<div class="login-container">
|
|
|
+ <div class="lang">
|
|
|
+ <el-dropdown trigger="click" @command="translate">
|
|
|
+ <span class="el-dropdown-link svgs">
|
|
|
+ <svg-icon icon-class="lang" />
|
|
|
+ </span>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item command="zh-CN">简体中文</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="en-US">English</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+</el-dropdown>
|
|
|
+ </div>
|
|
|
<div class="new-login">
|
|
|
<div class="new-login-l">
|
|
|
<div class="imgs">
|
|
@@ -76,6 +87,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
return {
|
|
|
+ lang:"",
|
|
|
loginForm: {
|
|
|
username: '',
|
|
|
password: ''
|
|
@@ -113,6 +125,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+
|
|
|
var that = this
|
|
|
document.onkeydown = function (e) {
|
|
|
e = window.event || e
|
|
@@ -126,11 +139,22 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- mounted: function () {
|
|
|
+ mounted() {
|
|
|
// 读取cookie中的账号信息,如果有accountInfo的话,则说明该用户之前勾选了记住密码的功能,则需要自动填上账号密码
|
|
|
+ this.setSwitch()
|
|
|
this.loadAccountInfo()
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 获取浏览器当前中英文
|
|
|
+ setSwitch() {
|
|
|
+ this.lang =localStorage.getItem('lang') || navigator.language
|
|
|
+
|
|
|
+ },
|
|
|
+ // 切换中英文的调用
|
|
|
+ translate(val) {
|
|
|
+ this.$i18n.locale = val
|
|
|
+ localStorage.setItem('lang',val)
|
|
|
+ },
|
|
|
showPwd() {
|
|
|
if (this.passwordType === 'password') {
|
|
|
this.passwordType = ''
|
|
@@ -435,6 +459,15 @@ $light_gray: #000;
|
|
|
$bg: #ccc;
|
|
|
$light_gray: #ccc;
|
|
|
$cursor: #000;
|
|
|
+.lang{
|
|
|
+ float:right;
|
|
|
+ padding-right: 50px;
|
|
|
+ margin-top: 30px;
|
|
|
+ cursor: pointer;
|
|
|
+ .svgs{
|
|
|
+ font-size:32px;
|
|
|
+ }
|
|
|
+}
|
|
|
.login-container {
|
|
|
position: relative;
|
|
|
height: 100%;
|