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