parent
3a5325039b
commit
89dde814d4
@ -1,44 +1,54 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<navigation-general title="个人信息">
|
||||||
<uni-list>
|
<view class="container">
|
||||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" title="昵称" :rightText="user.nickName" />
|
<uni-list>
|
||||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" title="手机号码" :rightText="user.phonenumber" />
|
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" title="昵称"
|
||||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'email-filled'}" title="邮箱" :rightText="user.email" />
|
:rightText="user.nickName" />
|
||||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" title="岗位" :rightText="postGroup" />
|
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" title="手机号码"
|
||||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'staff-filled'}" title="角色" :rightText="roleGroup" />
|
:rightText="user.phonenumber" />
|
||||||
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" title="创建日期" :rightText="user.createTime" />
|
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'email-filled'}" title="邮箱"
|
||||||
</uni-list>
|
:rightText="user.email" />
|
||||||
</view>
|
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" title="岗位"
|
||||||
|
:rightText="postGroup" />
|
||||||
|
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'staff-filled'}" title="角色"
|
||||||
|
:rightText="roleGroup" />
|
||||||
|
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" title="创建日期"
|
||||||
|
:rightText="user.createTime" />
|
||||||
|
</uni-list>
|
||||||
|
</view>
|
||||||
|
</navigation-general>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getUserProfile } from "@/api/system/user"
|
import {
|
||||||
|
getUserProfile
|
||||||
|
} from "@/api/system/user"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
user: {},
|
user: {},
|
||||||
roleGroup: "",
|
roleGroup: "",
|
||||||
postGroup: ""
|
postGroup: ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.getUser()
|
this.getUser()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getUser() {
|
getUser() {
|
||||||
getUserProfile().then(response => {
|
getUserProfile().then(response => {
|
||||||
this.user = response.data
|
this.user = response.data
|
||||||
this.roleGroup = response.roleGroup
|
this.roleGroup = response.roleGroup
|
||||||
this.postGroup = response.postGroup
|
this.postGroup = response.postGroup
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page {
|
page {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -1,85 +1,89 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="pwd-retrieve-container">
|
<navigation-general title="修改密码">
|
||||||
<uni-forms ref="form" :value="user" labelWidth="80px">
|
<view class="pwd-retrieve-container">
|
||||||
<uni-forms-item name="oldPassword" label="旧密码">
|
<uni-forms ref="form" :value="user" labelWidth="80px">
|
||||||
<uni-easyinput type="password" v-model="user.oldPassword" placeholder="请输入旧密码" />
|
<uni-forms-item name="oldPassword" label="旧密码">
|
||||||
</uni-forms-item>
|
<uni-easyinput type="password" v-model="user.oldPassword" placeholder="请输入旧密码" />
|
||||||
<uni-forms-item name="newPassword" label="新密码">
|
</uni-forms-item>
|
||||||
<uni-easyinput type="password" v-model="user.newPassword" placeholder="请输入新密码" />
|
<uni-forms-item name="newPassword" label="新密码">
|
||||||
</uni-forms-item>
|
<uni-easyinput type="password" v-model="user.newPassword" placeholder="请输入新密码" />
|
||||||
<uni-forms-item name="confirmPassword" label="确认密码">
|
</uni-forms-item>
|
||||||
<uni-easyinput type="password" v-model="user.confirmPassword" placeholder="请确认新密码" />
|
<uni-forms-item name="confirmPassword" label="确认密码">
|
||||||
</uni-forms-item>
|
<uni-easyinput type="password" v-model="user.confirmPassword" placeholder="请确认新密码" />
|
||||||
<button type="primary" @click="submit">提交</button>
|
</uni-forms-item>
|
||||||
</uni-forms>
|
|
||||||
</view>
|
</uni-forms>
|
||||||
|
</view>
|
||||||
|
<bottom-btn type="primary" title="提交" @handlerClick="submit"></bottom-btn>
|
||||||
|
</navigation-general>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { updateUserPwd } from "@/api/system/user"
|
import {
|
||||||
|
updateUserPwd
|
||||||
|
} from "@/api/system/user"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
user: {
|
user: {
|
||||||
oldPassword: undefined,
|
oldPassword: undefined,
|
||||||
newPassword: undefined,
|
newPassword: undefined,
|
||||||
confirmPassword: undefined
|
confirmPassword: undefined
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
oldPassword: {
|
oldPassword: {
|
||||||
rules: [{
|
rules: [{
|
||||||
required: true,
|
required: true,
|
||||||
errorMessage: '旧密码不能为空'
|
errorMessage: '旧密码不能为空'
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
newPassword: {
|
newPassword: {
|
||||||
rules: [{
|
rules: [{
|
||||||
required: true,
|
required: true,
|
||||||
errorMessage: '新密码不能为空',
|
errorMessage: '新密码不能为空',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
minLength: 6,
|
minLength: 6,
|
||||||
maxLength: 20,
|
maxLength: 20,
|
||||||
errorMessage: '长度在 6 到 20 个字符'
|
errorMessage: '长度在 6 到 20 个字符'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
confirmPassword: {
|
confirmPassword: {
|
||||||
rules: [{
|
rules: [{
|
||||||
required: true,
|
required: true,
|
||||||
errorMessage: '确认密码不能为空'
|
errorMessage: '确认密码不能为空'
|
||||||
}, {
|
}, {
|
||||||
validateFunction: (rule, value, data) => data.newPassword === value,
|
validateFunction: (rule, value, data) => data.newPassword === value,
|
||||||
errorMessage: '两次输入的密码不一致'
|
errorMessage: '两次输入的密码不一致'
|
||||||
}
|
}]
|
||||||
]
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
onReady() {
|
||||||
onReady() {
|
this.$refs.form.setRules(this.rules)
|
||||||
this.$refs.form.setRules(this.rules)
|
},
|
||||||
},
|
methods: {
|
||||||
methods: {
|
submit() {
|
||||||
submit() {
|
this.$refs.form.validate().then(res => {
|
||||||
this.$refs.form.validate().then(res => {
|
updateUserPwd(this.user.oldPassword, this.user.newPassword).then(response => {
|
||||||
updateUserPwd(this.user.oldPassword, this.user.newPassword).then(response => {
|
this.$modal.msgSuccess("修改成功")
|
||||||
this.$modal.msgSuccess("修改成功")
|
})
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page {
|
page {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pwd-retrieve-container {
|
.pwd-retrieve-container {
|
||||||
padding-top: 36rpx;
|
padding-top: 36rpx;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
Loading…
Reference in new issue