|
@@ -1,20 +1,20 @@
|
|
|
<!-- 系统公告 -->
|
|
<!-- 系统公告 -->
|
|
|
<template>
|
|
<template>
|
|
|
- <app-drawer title="修改登录密码" :width="400" v-model:show="show" :loading="loading" :refresh="refresh">
|
|
|
|
|
- <el-form ref="formRef" class="el-form--vertical" label-width="80px" :model="formData" :rules="formRules">
|
|
|
|
|
- <el-form-item label="原密码" prop="OldPwd">
|
|
|
|
|
- <el-input placeholder="请输入原密码" show-password v-model="formData.OldPwd" />
|
|
|
|
|
|
|
+ <app-drawer :title="t('user.password.title1')" :width="480" v-model:show="show" :loading="loading" :refresh="refresh">
|
|
|
|
|
+ <el-form ref="formRef" class="el-form--vertical" label-width="110px" :model="formData" :rules="formRules">
|
|
|
|
|
+ <el-form-item :label="t('user.password.oldpwd')" prop="OldPwd">
|
|
|
|
|
+ <el-input :placeholder="t('user.password.tips1')" show-password v-model="formData.OldPwd" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="新密码" prop="NewPwd">
|
|
|
|
|
|
|
+ <el-form-item :label="t('user.password.newpwd')" prop="NewPwd">
|
|
|
<el-tooltip placement="top" trigger="click" :hide-after="0">
|
|
<el-tooltip placement="top" trigger="click" :hide-after="0">
|
|
|
<template #content>
|
|
<template #content>
|
|
|
<span style="color: #f2f2f2;">{{ validateRules.password.message }}</span>
|
|
<span style="color: #f2f2f2;">{{ validateRules.password.message }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
- <el-input placeholder="请输入新密码" show-password v-model="formData.NewPwd" />
|
|
|
|
|
|
|
+ <el-input :placeholder="t('user.password.tips2')" show-password v-model="formData.NewPwd" />
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="确认密码" prop="Confirmpassword">
|
|
|
|
|
- <el-input placeholder="请重新输入新密码" show-password v-model="Confirmpassword" />
|
|
|
|
|
|
|
+ <el-form-item :label="t('user.password.confirmpwd')" prop="Confirmpassword">
|
|
|
|
|
+ <el-input :placeholder="t('user.password.tips3')" show-password v-model="Confirmpassword" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<template #footer>
|
|
<template #footer>
|
|
@@ -42,14 +42,14 @@ const Confirmpassword = ref('')
|
|
|
const { t } = i18n.global
|
|
const { t } = i18n.global
|
|
|
|
|
|
|
|
const formRules: FormRules = {
|
|
const formRules: FormRules = {
|
|
|
- OldPwd: [{ required: true, message: '请输入原密码', trigger: 'blur' }],
|
|
|
|
|
|
|
+ OldPwd: [{ required: true, message: t('user.password.tips1'), trigger: 'blur' }],
|
|
|
NewPwd: [{
|
|
NewPwd: [{
|
|
|
required: true,
|
|
required: true,
|
|
|
validator: (rule, value, callback) => {
|
|
validator: (rule, value, callback) => {
|
|
|
if (validateRules.password.validate(value)) {
|
|
if (validateRules.password.validate(value)) {
|
|
|
callback()
|
|
callback()
|
|
|
} else {
|
|
} else {
|
|
|
- callback(new Error('请输入新密码'))
|
|
|
|
|
|
|
+ callback(new Error(t('user.password.tips2')))
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
trigger: 'blur'
|
|
trigger: 'blur'
|
|
@@ -61,7 +61,7 @@ const formRules: FormRules = {
|
|
|
if (Confirmpassword.value === formData.NewPwd) {
|
|
if (Confirmpassword.value === formData.NewPwd) {
|
|
|
callback()
|
|
callback()
|
|
|
} else {
|
|
} else {
|
|
|
- callback(new Error('密码输入不一致!'))
|
|
|
|
|
|
|
+ callback(new Error(t('user.password.tips4')))
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
trigger: 'blur'
|
|
trigger: 'blur'
|
|
@@ -79,9 +79,9 @@ const onSubmit = () => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
formSubmit().then(() => {
|
|
formSubmit().then(() => {
|
|
|
onCancel(true)
|
|
onCancel(true)
|
|
|
- eventBus.$emit('LogoutNotify', '密码修改成功,请重新登录。')
|
|
|
|
|
|
|
+ eventBus.$emit('LogoutNotify', t('user.password.tips5'))
|
|
|
}).catch((err) => {
|
|
}).catch((err) => {
|
|
|
- ElMessage.error('提交失败:' + err)
|
|
|
|
|
|
|
+ ElMessage.error(t('common.submitfailure') + err)
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|