设置和消息对接口 改回上报记录页面

This commit is contained in:
zhouyanli
2026-05-15 17:55:31 +08:00
parent 856f36455c
commit eb7d4da5e3
4 changed files with 268 additions and 318 deletions

View File

@@ -38,16 +38,15 @@
<script setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { onShow } from '@dcloudio/uni-app'
import { logout } from '../../api/api.js'
// 响应式数据
const phoneNumber = ref('') // 绑定手机号
const passwordNumber = ref('')
// 页面加载时可从接口获取用户信息
onLoad(option => {
// console.log('option',option)
passwordNumber.value = option.newPassword
// 页面显示时读取最新数据(从修改页返回也会触发)
onShow(() => {
const userInfo = uni.getStorageSync('tempChangePwdParams')
if (userInfo.phoneNumber) {
phoneNumber.value = userInfo.phoneNumber
@@ -92,25 +91,21 @@ const handleLogout = () => {
// 确认退出登录
const confirmLogout = () => {
// 模拟退出登录接口请求
uni.showLoading({ title: '退出中...' })
setTimeout(() => {
logout().then(res => {
if (res.code === 200) {
uni.clearStorageSync()
uni.showToast({ title: '退出登录成功', icon: 'success' })
uni.redirectTo({ url: '/pageSubPack/loginSub/pwd-login' })
} else {
uni.showToast({ title: res.msg || '退出失败', icon: 'none' })
}
}).catch(() => {
uni.showToast({ title: '退出失败,请重试', icon: 'none' })
}).finally(() => {
uni.hideLoading()
// 清除本地存储的token等信息
uni.clearStorageSync()
// 提示并跳转到登录页
uni.showToast({
title: '退出登录成功',
icon: 'success'
})
// 跳转到登录页,关闭所有页面
uni.redirectTo({
url: '/pageSubPack/loginSub/pwd-login'
})
}, 800)
})
}
</script>