diff --git a/app/src/components/widgets/user-info/user-info.vue b/app/src/components/widgets/user-info/user-info.vue index c6c1e9c1..7c687222 100644 --- a/app/src/components/widgets/user-info/user-info.vue +++ b/app/src/components/widgets/user-info/user-info.vue @@ -17,7 +17,7 @@ 未登录 - + diff --git a/app/src/pages/change_password/change_password.vue b/app/src/pages/change_password/change_password.vue index f9d044b1..8cb0dd92 100644 --- a/app/src/pages/change_password/change_password.vue +++ b/app/src/pages/change_password/change_password.vue @@ -3,11 +3,14 @@ class="register bg-white min-h-full flex flex-col items-center px-[40rpx] pt-[100rpx] box-border" > - 修改登录密码 + + {{ type == 'set' ? '设置登录密码' : '修改登录密码' }} + - + import { userChangePwd } from '@/api/user' -import { reactive } from 'vue' +import { onLoad } from '@dcloudio/uni-app' +import { reactive, ref } from 'vue' -const formData = reactive({ - oldPassword: '', +const type = ref('') +const formData = reactive({ password: '', password2: '' }) const handleConfirm = async () => { - if (!formData.oldPassword) return uni.$u.toast('请输入原来的密码') + if (!formData.oldPassword && type.value != 'set') return uni.$u.toast('请输入原来的密码') if (!formData.password) return uni.$u.toast('请输入密码') if (!formData.password2) return uni.$u.toast('请输入确认密码') if (formData.password != formData.password2) return uni.$u.toast('两次输入的密码不一致') @@ -58,6 +62,15 @@ const handleConfirm = async () => { uni.$u.toast('操作成功') uni.navigateBack() } + +onLoad((options) => { + type.value = options.type || '' + if (type.value == 'set') { + uni.setNavigationBarTitle({ + title: '设置登录密码' + }) + } +})