This commit is contained in:
2023-12-04 15:55:54 +08:00
parent 6acd69004c
commit c7a2530464
4 changed files with 28 additions and 10 deletions

View File

@@ -5,7 +5,9 @@ module.exports = {
password: 'Password', password: 'Password',
domainnameaddress: 'Domain Address', domainnameaddress: 'Domain Address',
refreshtime: 'Refresh Time(s)', refreshtime: 'Refresh Time(s)',
login: 'Login' login: 'Login',
toast1: 'Please enter one user name',
toast2: 'Please enter password'
}, },
homeinfo: { homeinfo: {
topinfo: 'Device information', topinfo: 'Device information',
@@ -136,6 +138,10 @@ module.exports = {
exit: 'Exit', exit: 'Exit',
oldpassword: 'Old Password', oldpassword: 'Old Password',
newpassword: 'New Password', newpassword: 'New Password',
operationfailed: 'Operation failed' operationfailed: 'Operation failed',
toast1: 'Old password cannot be empty',
toast2: 'The new password cannot be empty',
toast3: 'Enter a new password',
toast4: 'The new password input is inconsistent, please re-enter it'
} }
} }

View File

@@ -5,7 +5,9 @@ module.exports = {
password: '密码', password: '密码',
domainnameaddress: '域名地址', domainnameaddress: '域名地址',
refreshtime: '刷新时间(秒)', refreshtime: '刷新时间(秒)',
login: '登录' login: '登录',
toast1: '请输入用户名',
toast2: '请输入密码'
}, },
homeinfo: { homeinfo: {
topinfo: '设备信息', topinfo: '设备信息',
@@ -136,6 +138,10 @@ module.exports = {
exit: '退出', exit: '退出',
oldpassword: '旧的密码', oldpassword: '旧的密码',
newpassword: '新的密码', newpassword: '新的密码',
operationfailed: '操作失败' operationfailed: '操作失败',
toast1: '旧密码不能为空',
toast2: '新密码不能为空',
toast3: '输入新密码',
toast4: '新密码输入不一致,请重新输入'
} }
} }

View File

@@ -135,12 +135,14 @@ export default {
saveLogin () { saveLogin () {
this.disabled = true this.disabled = true
if (!this.username) { if (!this.username) {
this.toast('请输入用户名') // this.toast('请输入用户名')
this.toast(this.$t('login.toast1'))
this.disabled = false this.disabled = false
return return
} }
if (!this.password) { if (!this.password) {
this.toast('请输入密码') // this.toast('请输入密码')
this.toast(this.$t('login.toast2'))
this.disabled = false this.disabled = false
return return
} }

View File

@@ -308,22 +308,26 @@ export default {
async _updatePass () { async _updatePass () {
this.$refs.child.disabled = true this.$refs.child.disabled = true
if (!this.oldpassword) { if (!this.oldpassword) {
this.toast('旧密码不能为空') // this.toast('旧密码不能为空')
this.toast(this.$t('common.toast1'))
this.$refs.child.disabled = false this.$refs.child.disabled = false
return return
} }
if (!this.newpassword1) { if (!this.newpassword1) {
this.toast('新密码不能为空') // this.toast('新密码不能为空')
this.toast(this.$t('common.toast2'))
this.$refs.child.disabled = false this.$refs.child.disabled = false
return return
} }
if (!this.newpassword2) { if (!this.newpassword2) {
this.toast('输入新密码') // this.toast('输入新密码')
this.toast(this.$t('common.toast3'))
this.$refs.child.disabled = false this.$refs.child.disabled = false
return return
} }
if (this.newpassword1 !== this.newpassword2) { if (this.newpassword1 !== this.newpassword2) {
this.toast('新密码输入不一致,请重新输入') // this.toast('新密码输入不一致,请重新输入')
this.toast(this.$t('common.toast4'))
this.$refs.child.disabled = false this.$refs.child.disabled = false
return return
} }