You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
149 lines
2.9 KiB
149 lines
2.9 KiB
3 years ago
|
<template>
|
||
|
<view class="page">
|
||
|
|
||
|
<view class="items">
|
||
|
<view class="item">
|
||
|
<view class="text" @tap="changePassword()">
|
||
|
旧密码
|
||
|
</view>
|
||
|
<view class="input">
|
||
|
<input type="password" placeholder="请输入旧密码" v-model="list.oldpassword">
|
||
|
</view>
|
||
|
</view>
|
||
|
<view class="item">
|
||
|
<view class="text" @tap="changePassword()">
|
||
|
新密码
|
||
|
</view>
|
||
|
<view class="input">
|
||
|
<input type="password" placeholder="请输入新密码" v-model="list.newpassword">
|
||
|
</view>
|
||
|
</view>
|
||
|
<view class="item">
|
||
|
<view class="text" @tap="changePassword()">
|
||
|
确认密码
|
||
|
</view>
|
||
|
<view class="input">
|
||
|
<input type="password" placeholder="请确认密码" v-model="list.truepassword">
|
||
|
</view>
|
||
|
</view>
|
||
|
</view>
|
||
|
<view class="button">
|
||
3 years ago
|
<button @tap="xiugai()">确定</button>
|
||
3 years ago
|
</view>
|
||
|
</view>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
data() {
|
||
|
return {
|
||
|
list:{
|
||
|
newpassword:"",
|
||
|
oldpassword:"",
|
||
|
truepassword:""
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
onLoad() {
|
||
|
|
||
|
},
|
||
|
methods: {
|
||
|
|
||
3 years ago
|
xiugai(){
|
||
3 years ago
|
if(this.list.truepassword!=this.list.newpassword){
|
||
|
return this.$alert.showError("两次输入不一致")
|
||
|
}
|
||
|
let bady={
|
||
|
oldPassword: this.list.oldpassword,
|
||
|
newPassword: this.list.newpassword
|
||
|
}
|
||
|
this.$request.patch('/api/Accounts/ChangePassword',bady,(data,res)=>{
|
||
3 years ago
|
console.log(res);
|
||
|
if(res){
|
||
|
return this.$alert.showError(res)
|
||
|
}else{
|
||
|
this.$auth.logout()
|
||
|
}
|
||
3 years ago
|
})
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style lang="scss">
|
||
|
.page {
|
||
|
|
||
|
|
||
|
.top{
|
||
|
background: linear-gradient(180deg, #317AFF 0%, #ACD1FF 100%);
|
||
|
height: 300rpx;
|
||
|
padding: 20rpx 40rpx;
|
||
|
.box{
|
||
|
display: flex;
|
||
|
.portrait{
|
||
|
width: 150rpx;
|
||
|
height: 150rpx;
|
||
|
border-radius: 150rpx;
|
||
|
border: 6rpx solid #fff;
|
||
|
img{
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
border-radius: 150rpx;
|
||
|
}
|
||
|
}
|
||
|
.information{
|
||
|
color: #fff;
|
||
|
margin: 30rpx 20rpx;
|
||
|
font-size: 36rpx;
|
||
|
.name{
|
||
|
margin-bottom: 20rpx;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
.items{
|
||
|
width: 100%;
|
||
|
// margin-top: -40rpx;
|
||
|
|
||
|
.item{
|
||
|
margin-top: 20rpx;
|
||
|
display: flex;
|
||
|
background-color: #fff;
|
||
|
// width: 90%;
|
||
|
margin: 0 auto;
|
||
|
height: 80rpx;
|
||
|
line-height: 80rpx;
|
||
|
// border-radius: 10rpx;
|
||
|
padding-left: 20rpx;
|
||
|
border-bottom: 2rpx solid #E4E7EC;
|
||
|
.text{
|
||
|
width: 180rpx;
|
||
|
}
|
||
|
.input{
|
||
|
margin-left: 20rpx;
|
||
|
flex: 1;
|
||
|
height: 100%;
|
||
|
input{
|
||
|
margin-top: 20rpx;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
.button{
|
||
|
margin-top: 80rpx;
|
||
|
button {
|
||
|
width: 100%;
|
||
|
// height: 140rpx;
|
||
|
// background: linear-gradient(180deg, #317AFF 0%, #0052E6 100%);
|
||
|
color: #fff;
|
||
|
border-radius: 120rpx;
|
||
|
background: #4963F4;
|
||
|
box-shadow: 2px 6px 8px 1px rgba(73, 99, 244, 0.8);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
</style>
|