<template>
|
<view class="page-container">
|
<view class="content">
|
<view class="input-wrapper">
|
<view class="input-item">
|
<view class="left">当前用户: </view>
|
<view class="right">
|
<input type="text" v-model="userInfo.user" />
|
</view>
|
</view>
|
<view class="input-item">
|
<view class="left">当前密码: </view>
|
<view class="right">
|
<input password type="safe-password" v-model="userInfo.oldPassword" />
|
</view>
|
</view>
|
<view class="input-item">
|
<view class="left">新密码: </view>
|
<view class="right">
|
<input password type="safe-password" v-model="userInfo.password" />
|
</view>
|
</view>
|
<view class="input-item">
|
<view class="left">确认新密码: </view>
|
<view class="right">
|
<input password type="safe-password" v-model="userInfo.repeatPassword" />
|
</view>
|
</view>
|
<view class="input-item">
|
<view class="left">金蝶云账号: </view>
|
<view class="right">
|
<input type="text" v-model="userInfo.HCloudUserName" />
|
</view>
|
</view>
|
<view class="input-item">
|
<view class="left">金蝶云密码: </view>
|
<view class="right">
|
<input type="text" v-model="userInfo.HCloudUserPsd" />
|
</view>
|
</view>
|
</view>
|
</view>
|
<view class="footer">
|
<view><button class="btn-a" @click="onConfirmModifyClickHandler">确认修改</button></view>
|
<view><button class="btn-c" @click="onExitClickHandler">退出</button></view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import {
|
getLoginData,
|
getUserInfo
|
} from '../../utils/auth';
|
import {
|
CommonUtils
|
} from '../../utils/common';
|
export default {
|
data() {
|
return {
|
userInfo: {
|
user: getLoginData()['UserName'],
|
oldPassword: getLoginData()['PassWord'],
|
password: '',
|
repeatPassword: '',
|
HCloudUserName: getUserInfo()['HCloudUserName'],
|
HCloudUserPsd: getUserInfo()['HCloudUserPsd']
|
}
|
};
|
},
|
methods: {
|
onConfirmModifyClickHandler() {
|
CommonUtils.doRequest2({
|
url: '/Web/GetXGPassword',
|
data: {
|
"UserName": this.userInfo.user,
|
"oldPassword": this.userInfo.oldPassword,
|
"PassWord": this.userInfo.password,
|
"Repassword": this.userInfo.repeatPassword,
|
"HCloudUserName": this.userInfo.HCloudUserName,
|
"HCloudUserPsd": this.userInfo.HCloudUserPsd
|
},
|
resFunction: (res) => {
|
console.log("res: ", res)
|
let {count, Message} = res.data
|
if (count == 1) {
|
uni.showModal({
|
content: Message,
|
success({
|
confirm
|
}) {
|
console.log(confirm)
|
if (confirm == true) {
|
uni.reLaunch({
|
url: "/pages/index/login"
|
})
|
}
|
}
|
})
|
} else {
|
this.userInfo.password = ''
|
this.userInfo.repeatPassword = ''
|
uni.showModal({
|
content: Message,
|
})
|
}
|
},
|
errFunction: (err) => {
|
uni.showModal({
|
content: err.Message,
|
})
|
}
|
})
|
},
|
|
onExitClickHandler() {
|
uni.navigateBack()
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
.content {
|
box-sizing: border-box;
|
padding: 20rpx;
|
|
.input-wrapper {
|
box-sizing: border-box;
|
padding: 20rpx 0 0 0;
|
display: flex;
|
flex-direction: column;
|
gap: 20rpx;
|
|
.input-item {
|
flex: 1;
|
display: flex;
|
flex-direction: row;
|
align-items: center;
|
gap: 10rpx;
|
padding: 0 10rpx;
|
|
.left {
|
width: 6rem;
|
}
|
|
.right {
|
flex: 1;
|
border: 1px solid #e2e2e2;
|
border-radius: 5px;
|
display: flex;
|
justify-content: center;
|
|
input {
|
display: inline-block;
|
padding: 16rpx 30rpx;
|
}
|
}
|
|
}
|
}
|
}
|
|
.footer {
|
position: fixed;
|
bottom: 0;
|
display: flex;
|
box-sizing: border-box;
|
width: 100%;
|
justify-content: space-between;
|
align-items: center;
|
padding: 40rpx;
|
background-color: #fff;
|
box-shadow: 0 2rpx 10rpx 2rpx rgba(0, 0, 0, 0.4);
|
|
button {
|
border-radius: 50rpx;
|
width: 180rpx;
|
height: 66rpx;
|
line-height: 66rpx;
|
font-size: 28rpx;
|
}
|
|
.btn-a {
|
background-color: #3A78FF;
|
color: #fff;
|
}
|
|
.btn-b {
|
background-color: #41a863;
|
color: #fff;
|
}
|
|
.btn-c {
|
background-color: #acacac;
|
color: #fff;
|
}
|
|
.btn-d {
|
background-color: #ff8901;
|
color: #fff;
|
}
|
}
|
</style>
|