No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 
 

60 líneas
1.5 KiB

  1. <template>
  2. <view class="page">
  3. <l-title>修改密码</l-title>
  4. <l-input v-model="oldPwd" title="旧密码" placeholder="请输入旧密码" password></l-input>
  5. <l-input v-model="newPwd" title="新的密码" placeholder="请输入新密码" password></l-input>
  6. <l-input v-model="confirmPwd" title="确认输入" placeholder="请再次输入新密码" password></l-input>
  7. <view class="padding">
  8. <l-button @click="submit" size="lg" color="blue" class="block" block>确认修改</l-button>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. data() {
  15. return {
  16. oldPwd: '',
  17. newPwd: '',
  18. confirmPwd: ''
  19. }
  20. },
  21. methods: {
  22. // 提交修改
  23. async submit() {
  24. const { auth, oldPwd, newPwd, confirmPwd } = this
  25. if (oldPwd.length < 6) {
  26. this.CONFIRM('操作失败', '旧密码输入不正确,请重新确认')
  27. return
  28. }
  29. if (newPwd.length < 6 || newPwd.length > 16) {
  30. this.CONFIRM('操作失败', '新密码不符合要求,请修改后重试')
  31. return
  32. }
  33. if (newPwd !== confirmPwd) {
  34. this.CONFIRM('操作失败', '新密码和确认密码输入不一致,请修改')
  35. return
  36. }
  37. const success = await this.HTTP_POST(
  38. 'learun/adms/user/modifypw',
  39. {
  40. newpassword: this.md5(newPwd),
  41. oldpassword: this.md5(oldPwd)
  42. },
  43. '未能成功修改密码'
  44. )
  45. if (!success) {
  46. return
  47. }
  48. this.NAV_BACK()
  49. this.TOAST('密码修改成功')
  50. }
  51. }
  52. }
  53. </script>