diff --git a/nezha-fronted/src/components/page/config/profileChangePin.vue b/nezha-fronted/src/components/page/config/profileChangePin.vue index 058733a3d..ef4b6e6e9 100644 --- a/nezha-fronted/src/components/page/config/profileChangePin.vue +++ b/nezha-fronted/src/components/page/config/profileChangePin.vue @@ -4,7 +4,7 @@
- + @@ -50,13 +50,12 @@ export default { } return { user: { - pin: '', + oldPin: '', newPin: '', confirmPin: '' }, - userId: localStorage.getItem('nz-user-id'), rules: { - pin: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }], + oldPin: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }], newPin: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }, { validator: validatePass, trigger: 'blur' }], confirmPin: [{ required: true, message: this.$t('config.user.reinputPin'), trigger: 'blur' }, { validator: validateConfirmPass, trigger: 'blur' }] }, @@ -80,14 +79,13 @@ export default { this.$refs.changePinForm.validate((valid) => { if (valid) { const paramObj = { - pin: this.user.pin, - newPin: this.user.newPin, - id: this.userId + oldPin: this.user.oldPin, + newPin: this.user.newPin } - this.$put('/sys/user/pin?oldPin=' + paramObj.pin + '&newPin=' + paramObj.newPin + '&id=' + paramObj.id).then(response => { + this.$put('/sys/user/pin', paramObj).then(response => { if (response && response.code == 200) { this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') }) - this.user.pin = '' + this.user.oldPin = '' this.user.newPin = '' this.user.confirmPin = '' } else {