| | |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | var _default = { |
| | | data: function data() { |
| | | return { |
| | | form: { |
| | | oldPassword: '', |
| | | password: '', |
| | | confirmPassword: '' |
| | | } |
| | |
| | | }, |
| | | methods: { |
| | | handleSubmit: function handleSubmit() { |
| | | var _this = this; |
| | | if (!this.form.oldPassword) { |
| | | uni.showToast({ |
| | | title: '请输入原始密码', |
| | | icon: 'none' |
| | | }); |
| | | return; |
| | | } |
| | | if (!this.form.password) { |
| | | uni.showToast({ |
| | | title: '请输入新密码', |
| | |
| | | title: '修改中...' |
| | | }); |
| | | this.$u.api.changePassword({ |
| | | newPassword: this.form.password |
| | | newPassword: this.form.password, |
| | | oldPassword: this.form.oldPassword |
| | | }).then(function (res) { |
| | | uni.hideLoading(); |
| | | if (res.code === 200) { |
| | | uni.showToast({ |
| | | title: '修改成功', |
| | | title: '修改成功,下次登录请使用新密码登录', |
| | | icon: 'success' |
| | | }); |
| | | setTimeout(function () { |
| | | _this.$store.commit('clearAll'); |
| | | uni.reLaunch({ |
| | | url: '/pages/login/login' |
| | | }); |
| | | }, 1500); |
| | | } |
| | | }).catch(function (err) { |
| | | uni.hideLoading(); |