增加密码错误的异常捕获和oa自动登录
This commit is contained in:
@@ -3,21 +3,13 @@
|
||||
<view class="self_info_row"></view>
|
||||
|
||||
<view class="info_card">
|
||||
<my-avatar
|
||||
:src="selfInfo.faceURL || '/static/images/default_avatar.png'"
|
||||
:desc="selfInfo.nickname"
|
||||
size="46"
|
||||
/>
|
||||
<my-avatar :src="selfInfo.faceURL || '/static/images/default_avatar.png'" :desc="selfInfo.nickname" size="46" />
|
||||
|
||||
<view class="id_row">
|
||||
<text class="nickname">{{ selfInfo.nickname }}</text>
|
||||
<view class="id_row_copy" @click="copy">
|
||||
<text class="id">{{ selfInfo.userID }}</text>
|
||||
<image
|
||||
style="width: 32rpx; height: 32rpx"
|
||||
src="@/static/images/id_copy.png"
|
||||
mode=""
|
||||
/>
|
||||
<image style="width: 32rpx; height: 32rpx" src="@/static/images/id_copy.png" mode="" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -28,12 +20,7 @@
|
||||
</view>
|
||||
|
||||
<view class="action_box">
|
||||
<view
|
||||
@click="profileMenuClick(item)"
|
||||
class="profile_menu_item"
|
||||
v-for="item in profileMenus"
|
||||
:key="item.idx"
|
||||
>
|
||||
<view @click="profileMenuClick(item)" class="profile_menu_item" v-for="item in profileMenus" :key="item.idx">
|
||||
<view class="menu_left">
|
||||
<image style="width: 48rpx; height: 48rpx" :src="item.icon" mode="" />
|
||||
<text>{{ item.title }}</text>
|
||||
@@ -76,13 +63,18 @@ export default {
|
||||
title: "应用更新",
|
||||
icon: require("static/images/profile_menu_about.png"),
|
||||
},
|
||||
{
|
||||
idx: 5,
|
||||
title: '测试推送',
|
||||
icon: require("static/images/profile_menu_about.png")
|
||||
},
|
||||
{
|
||||
idx: 5,
|
||||
title: '测试推送',
|
||||
icon: require("static/images/profile_menu_about.png")
|
||||
},
|
||||
{
|
||||
idx: 6,
|
||||
title: "清理缓存",
|
||||
icon: require("static/images/profile_menu_about.png"),
|
||||
},
|
||||
{
|
||||
idx: 7,
|
||||
title: "退出登录",
|
||||
icon: require("static/images/profile_menu_logout.png"),
|
||||
},
|
||||
@@ -149,19 +141,22 @@ export default {
|
||||
case 4:
|
||||
this.showUpdateOptions();
|
||||
break;
|
||||
case 5:
|
||||
uni.createPushMessage({
|
||||
content: '今天还没有报工哦',
|
||||
title: "报工提醒",
|
||||
success() {
|
||||
console.log('推送成功')
|
||||
},
|
||||
fail() {
|
||||
console.log("推送失败")
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 5:
|
||||
uni.createPushMessage({
|
||||
content: '今天还没有报工哦',
|
||||
title: "报工提醒",
|
||||
success() {
|
||||
console.log('推送成功')
|
||||
},
|
||||
fail() {
|
||||
console.log("推送失败")
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 6:
|
||||
this.clearCache();
|
||||
break;
|
||||
case 7:
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "确定要退出当前账号吗?",
|
||||
@@ -189,7 +184,7 @@ export default {
|
||||
if (ignoredVersion) {
|
||||
content += `\n当前忽略版本:${ignoredVersion}`;
|
||||
}
|
||||
|
||||
|
||||
uni.showActionSheet({
|
||||
itemList: ['检查更新', '清除忽略版本', '取消'],
|
||||
success: (res) => {
|
||||
@@ -206,7 +201,7 @@ export default {
|
||||
success: (modalRes) => {
|
||||
if (modalRes.confirm) {
|
||||
uni.$updateManager.clearIgnoredVersion();
|
||||
uni.showToast({title: '已清除忽略版本设置'});
|
||||
uni.showToast({ title: '已清除忽略版本设置' });
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -218,6 +213,82 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
clearCache() {
|
||||
uni.showModal({
|
||||
title: "清理缓存",
|
||||
content: "确定要清理应用缓存吗?清理后需要重新登录。",
|
||||
confirmText: "确认清理",
|
||||
cancelText: "取消",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.showLoading({
|
||||
title: '清理中...'
|
||||
});
|
||||
|
||||
// 清理本地存储
|
||||
const clearStorageKeys = [
|
||||
'IMToken',
|
||||
'BusinessToken',
|
||||
'userInfo',
|
||||
'conversationList',
|
||||
'messageList',
|
||||
'contactList'
|
||||
];
|
||||
|
||||
clearStorageKeys.forEach(key => {
|
||||
try {
|
||||
uni.removeStorageSync(key);
|
||||
} catch (e) {
|
||||
console.log(`清理缓存失败: ${key}`, e);
|
||||
}
|
||||
});
|
||||
|
||||
// 清理文件缓存
|
||||
uni.getSavedFileList({
|
||||
success: (fileRes) => {
|
||||
if (fileRes.fileList && fileRes.fileList.length > 0) {
|
||||
fileRes.fileList.forEach(file => {
|
||||
uni.removeSavedFile({
|
||||
filePath: file.filePath,
|
||||
success: () => {
|
||||
console.log('文件缓存清理成功:', file.filePath);
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log('文件缓存清理失败:', file.filePath, err);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log('获取文件列表失败:', err);
|
||||
}
|
||||
});
|
||||
|
||||
// 清理图片缓存
|
||||
uni.getImageInfo({
|
||||
src: '/static/images/default_avatar.png',
|
||||
success: () => {
|
||||
// 这里可以添加更多图片缓存清理逻辑
|
||||
}
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '缓存清理完成',
|
||||
icon: 'success'
|
||||
});
|
||||
|
||||
// 清理完成后跳转到登录页
|
||||
setTimeout(() => {
|
||||
uni.$u.route("/pages/login/index");
|
||||
}, 1500);
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user