From d4c8381c84df8c44c102c84b413d03a4f76b0242 Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Mon, 15 Nov 2021 18:10:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20profileChangePin=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81=E9=A1=B5=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?PUT=E8=AF=B7=E6=B1=82=E5=8F=82=E6=95=B0=E4=BC=A0=E9=80=92?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/page/config/profileChangePin.vue | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) 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 {