|
|
@ -14,11 +14,15 @@ |
|
|
|
<view class="new_btn_bot"> |
|
|
|
<button class="new_save_btn" @click="submit">确认修改</button> |
|
|
|
</view> |
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { updateUserPwd } from '@/api/request2.js'; |
|
|
|
import { |
|
|
|
navigateBack, |
|
|
|
} from '@/common/basic.js'; |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
@ -87,14 +91,21 @@ |
|
|
|
// 触发提交表单 |
|
|
|
submit() { |
|
|
|
this.$refs.form.validate().then(res=>{ |
|
|
|
console.log(res) |
|
|
|
updateUserPwd(res.oldpassword,res.newpassword).then((ress)=>{ |
|
|
|
console.log('返回结果:', ress); |
|
|
|
if(ress.data){ |
|
|
|
this.showCommitSuccessMessage("修改成功") |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(err =>{ |
|
|
|
console.log('表单错误信息:', err); |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
showCommitSuccessMessage(hint) { |
|
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
|
navigateBack(1) |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|