Browse Source

修改密码问题

lijuncheng0816
zhang_li 4 months ago
parent
commit
aa24a51d04
  1. 2
      src/api/request2.js
  2. 15
      src/pages/setter/passwordpage.vue

2
src/api/request2.js

@ -92,7 +92,7 @@ export function updateUserPwd(oldPassword, newPassword) {
return request({
url: baseApi + '/system/user/profile/update-password',
method: 'PUT',
params: data
data: data
})
}

15
src/pages/setter/passwordpage.vue

@ -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>

Loading…
Cancel
Save