5.20宁夏新增修改密码
This commit is contained in:
parent
b9d9e240f2
commit
7da9ce7d63
|
|
@ -36,6 +36,14 @@ const user = {
|
|||
data,
|
||||
header
|
||||
)
|
||||
},
|
||||
async fixPwd (data = {} , header = {}){
|
||||
return await Http.put(
|
||||
HttpConfig.systemPath,
|
||||
HttpConfig.serviceUrl.user.fixPwd,
|
||||
data,
|
||||
header
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ class HttpConfig {
|
|||
},
|
||||
user: {
|
||||
logOut: '/logout', // 退出登录
|
||||
fixPwd: '/user/profile/updatePwd', //修改密码
|
||||
},
|
||||
index: {
|
||||
noticeCont: '/sysNotice/getList', // 获取公告内容
|
||||
|
|
|
|||
|
|
@ -451,6 +451,14 @@
|
|||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "pages/fixPwd/fixPwd",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "修改密码"
|
||||
}
|
||||
|
||||
}
|
||||
],
|
||||
"tabBar": {
|
||||
"color": "#2c2c2c",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,127 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="form-area">
|
||||
<uni-forms
|
||||
ref="pwdForm"
|
||||
:modelValue="pwdFormData"
|
||||
:rules="pwdFormRules"
|
||||
label-position="top"
|
||||
>
|
||||
<uni-forms-item name="oldPassword" required label="旧密码" label-width="100">
|
||||
<uni-easyinput type="password" placeholder="请输入" maxlength="60"
|
||||
v-model="pwdFormData.oldPassword"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item name="newPassword" required label="新密码" label-width="100">
|
||||
<uni-easyinput type="password" placeholder="请输入" maxlength="60"
|
||||
v-model="pwdFormData.newPassword"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item name="confirmNewPassword" required label="确认新密码" label-width="100">
|
||||
<uni-easyinput type="password" placeholder="请输入" maxlength="60"
|
||||
v-model="pwdFormData.confirmNewPassword"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<view
|
||||
class="sub-btn"
|
||||
@click="submitForm"
|
||||
>
|
||||
保存
|
||||
</view>
|
||||
</uni-forms>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
pwdFormData: {
|
||||
oldPassword: '',
|
||||
newPassword: '',
|
||||
confirmNewPassword: ''
|
||||
},
|
||||
pwdFormRules: {
|
||||
oldPassword: {
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
errorMessage: '请输入旧密码!'
|
||||
}
|
||||
]
|
||||
},
|
||||
newPassword: {
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
errorMessage: '请输入新密码!'
|
||||
}
|
||||
]
|
||||
},
|
||||
confirmNewPassword: {
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
errorMessage: '请确认新密码!'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submitForm() {
|
||||
let that = this
|
||||
that.$refs.pwdForm.validate().then(formData => {
|
||||
if (formData.newPassword != formData.confirmNewPassword) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '确认密码与新密码不一致!'
|
||||
})
|
||||
} else {
|
||||
console.log(formData);
|
||||
that.$api.user.fixPwd({
|
||||
oldPassword: formData.oldPassword,
|
||||
newPassword: formData.newPassword
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
if (res.data.code == 200) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '修改成功!',
|
||||
success: () => {
|
||||
uni.navigateBack()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: res.data.msg
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.form-area{
|
||||
width: 90%;
|
||||
margin: 40rpx auto;
|
||||
.sub-btn{
|
||||
width: 40%;
|
||||
margin: 100rpx auto;
|
||||
box-sizing: border-box;
|
||||
padding: 15rpx 30rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 15rpx;
|
||||
background-color: #3888FF;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -27,13 +27,16 @@
|
|||
<uni-easyinput type="password" placeholder="请输入密码" maxlength="60"
|
||||
v-model="accountFormData.password"></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<text style="
|
||||
<text
|
||||
style="
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
color: #3689FF;
|
||||
font-size: 14px;
|
||||
">
|
||||
"
|
||||
@click="forgetPwd"
|
||||
>
|
||||
忘记密码
|
||||
</text>
|
||||
<button class="submit-btn" @click="accountSubmit">登录</button>
|
||||
|
|
@ -122,6 +125,9 @@ export default {
|
|||
switchUpper(count) {
|
||||
this.switchStatus = count
|
||||
},
|
||||
forgetPwd () {
|
||||
console.log('忘记密码');
|
||||
},
|
||||
sendVeriCode() {
|
||||
let that = this
|
||||
let phoneReg = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/
|
||||
|
|
|
|||
|
|
@ -17,23 +17,23 @@
|
|||
<span>已认证</span>
|
||||
</h4>
|
||||
</view>
|
||||
<!-- <u-cell-group style="width: 95%; margin: 15rpx auto;" :border="false">
|
||||
<u-cell
|
||||
<u-cell-group style="width: 95%; margin: 15rpx auto;" :border="false">
|
||||
<!-- <u-cell
|
||||
title="个人信息"
|
||||
:isLink="true"
|
||||
icon="/static/personal.png"
|
||||
:border="false"
|
||||
>
|
||||
</u-cell>
|
||||
</u-cell> -->
|
||||
<u-cell
|
||||
title="设置"
|
||||
title="修改密码"
|
||||
:isLink="true"
|
||||
icon="/static/setting.png"
|
||||
url="/pages/fixPwd/fixPwd"
|
||||
:border="false"
|
||||
>
|
||||
</u-cell>
|
||||
</u-cell-group> -->
|
||||
<!-- <button ></button> -->
|
||||
</u-cell-group>
|
||||
<view
|
||||
class="exit-log"
|
||||
@click="exitLogin"
|
||||
|
|
|
|||
Loading…
Reference in New Issue