|
@@ -9,7 +9,7 @@
|
|
label-position="left"
|
|
label-position="left"
|
|
>
|
|
>
|
|
<div class="title-container">
|
|
<div class="title-container">
|
|
- <h3 class="title">系统登录</h3>
|
|
|
|
|
|
+ <h3 class="title">{{ $t('login') }}</h3>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<el-form-item prop="user_name">
|
|
<el-form-item prop="user_name">
|
|
@@ -19,7 +19,7 @@
|
|
ref="user_name"
|
|
ref="user_name"
|
|
name="user_name"
|
|
name="user_name"
|
|
auto-complete="on"
|
|
auto-complete="on"
|
|
- placeholder="用户名"
|
|
|
|
|
|
+ :placeholder="$t('username')"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
@@ -29,7 +29,7 @@
|
|
v-model="loginForm.password"
|
|
v-model="loginForm.password"
|
|
ref="password"
|
|
ref="password"
|
|
name="password"
|
|
name="password"
|
|
- placeholder="密码"
|
|
|
|
|
|
+ :placeholder="$t('password')"
|
|
auto-complete="on"
|
|
auto-complete="on"
|
|
@keyup.enter.native="handleLogin"
|
|
@keyup.enter.native="handleLogin"
|
|
/>
|
|
/>
|
|
@@ -42,8 +42,9 @@
|
|
type="primary"
|
|
type="primary"
|
|
:loading="loading"
|
|
:loading="loading"
|
|
@click.native.prevent="handleLogin('TEACHER')"
|
|
@click.native.prevent="handleLogin('TEACHER')"
|
|
- >教师登录</el-button
|
|
|
|
>
|
|
>
|
|
|
|
+ {{ $t('Learn_TLogin') }}
|
|
|
|
+ </el-button>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
@@ -52,8 +53,9 @@
|
|
type="primary"
|
|
type="primary"
|
|
:loading="loading"
|
|
:loading="loading"
|
|
@click.native.prevent="handleLogin('STUDENT')"
|
|
@click.native.prevent="handleLogin('STUDENT')"
|
|
- >学员登录</el-button
|
|
|
|
>
|
|
>
|
|
|
|
+ {{ $t('Learn_SLogin') }}
|
|
|
|
+ </el-button>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
</el-form>
|
|
</el-form>
|
|
@@ -61,18 +63,20 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import { updateLanguageList } from '@/utils/i18n';
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
const validateUsername = (rule, value, callback) => {
|
|
const validateUsername = (rule, value, callback) => {
|
|
if (!value) {
|
|
if (!value) {
|
|
- callback(new Error('请填写用户名!'));
|
|
|
|
|
|
+ callback(new Error(this.$i18n.tc('Learn_Login_user_warning')));
|
|
} else {
|
|
} else {
|
|
callback();
|
|
callback();
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const validatePassword = (rule, value, callback) => {
|
|
const validatePassword = (rule, value, callback) => {
|
|
if (value.length < 6) {
|
|
if (value.length < 6) {
|
|
- callback(new Error('密码不能少于六位'));
|
|
|
|
|
|
+ callback(new Error(this.$i18n.tc('Learn_Login_password_warning')));
|
|
} else {
|
|
} else {
|
|
callback();
|
|
callback();
|
|
}
|
|
}
|
|
@@ -99,6 +103,19 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ created() {
|
|
|
|
+ updateLanguageList({
|
|
|
|
+ word_key_list: [
|
|
|
|
+ 'login',
|
|
|
|
+ 'password',
|
|
|
|
+ 'username',
|
|
|
|
+ 'Learn_TLogin',
|
|
|
|
+ 'Learn_SLogin',
|
|
|
|
+ 'Learn_Login_user_warning',
|
|
|
|
+ 'Learn_Login_password_warning'
|
|
|
|
+ ]
|
|
|
|
+ });
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
handleLogin(user_type) {
|
|
handleLogin(user_type) {
|
|
this.$refs.loginForm.validate(valid => {
|
|
this.$refs.loginForm.validate(valid => {
|
|
@@ -153,7 +170,8 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
.login-button {
|
|
.login-button {
|
|
- margin: 0 81px;
|
|
|
|
|
|
+ display: block;
|
|
|
|
+ margin: 0 auto;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|