@@ -299,6 +299,7 @@ export default {
switchLanguageHints: 'Switch Language Success',
websiteTitle: 'Member Management System',
uploadHints: 'Uploading, please hold on. Do not close the window!',
+ canNotBeBlank: ' cannot be blank',
},
shop: {
@@ -297,6 +297,7 @@ export default {
switchLanguageHints: '语言切换成功',
websiteTitle: '会员管理系统',
uploadHints: '正在上传,请稍后。请勿关闭窗口!',
+ canNotBeBlank: '不能为空',
product: '商品',
@@ -210,6 +210,21 @@ export default {
})
handleLogin() {
+ if (!this.loginForm.username) {
+ this.$message({
+ message: this.$t('login.username') + this.$t('common.canNotBeBlank'),
+ type: 'error'
+ })
+ return false;
+ }
+ if (!this.loginForm.password) {
+ message: this.$t('login.password') + this.$t('common.canNotBeBlank'),
+
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true