修改cid无效、登录缓存问题,正在对接支付功能

This commit is contained in:
zhouyanli
2026-07-14 14:35:54 +08:00
parent 3124f95cb3
commit 173f1c4585
10 changed files with 391 additions and 121 deletions

View File

@@ -70,12 +70,12 @@
title: '注销账号',
type: 'arrow'
},
{
title: '升级版本',
type: 'text',
value: '当前版本 1.0.0',
valueClass: 'item-version'
}
// {
// title: '升级版本',
// type: 'text',
// value: '当前版本 1.0.0',
// valueClass: 'item-version'
// }
])
// 格式化字节大小
@@ -165,8 +165,8 @@
const checkVersionUpdate = async () => {
uni.showLoading({ title: '检查中...', mask: true })
// #ifdef APP-PLUS
// const channel = plus.runtime.channel; // 云打包自动写入,自定义包为空
// const channel = 'xioami'
const channel = plus.runtime.channel; // 云打包自动写入,自定义包为空
// const channel = 'xiaomi'
// console.log('channel',channel)
// #endif
@@ -174,8 +174,7 @@
const systemInfo = uni.getSystemInfoSync()
const platform = systemInfo.platform === 'android' ? 'android':'ios'
const appChannel = 'resident'
const channel = 'xiaomi'
// const channel = plus.runtime.channel;
// const channel = 'xiaomi'
// 1. 查询最新版本
const versionRes = await getAppVersion(platform, channel, appChannel)
@@ -299,6 +298,10 @@
});
authLogout().then(res => {
if (res.code === 200) {
// 清除本地登录凭证
uni.removeStorageSync('token');
uni.removeStorageSync('userId');
uni.removeStorageSync('currentVillageId');
uni.hideLoading();
uni.showToast({
title: '退出成功',
@@ -306,22 +309,30 @@
});
setTimeout(() => {
uni.hideLoading();
uni.redirectTo({
uni.reLaunch({
url: '/pageSubPack/loginSub/pwd-login'
});
}, 1500);
} else {
uni.showToast({
title: `${res.msg}`,
icon: 'error'
// 即使服务端返回失败,也清除本地数据并跳转登录页
uni.removeStorageSync('token');
uni.removeStorageSync('userId');
uni.removeStorageSync('currentVillageId');
uni.hideLoading();
uni.reLaunch({
url: '/pageSubPack/loginSub/pwd-login'
});
}
}).catch(err => {
console.log(err);
uni.showToast({
title: err.msg,
icon: 'error'
// 网络异常时也清除本地数据并跳转登录页
uni.removeStorageSync('token');
uni.removeStorageSync('userId');
uni.removeStorageSync('currentVillageId');
uni.hideLoading();
uni.reLaunch({
url: '/pageSubPack/loginSub/pwd-login'
});
})