From 00684d398b7233b78a7a706c22ab3894d968c2e4 Mon Sep 17 00:00:00 2001
From: jscyl13849007907 <13849007907@163.com>
Date: Fri, 15 May 2026 10:52:26 +0800
Subject: [PATCH] no message
---
root/person/avatar.vue | 18 +++++++++++++++---
root/person/info.vue | 4 +++-
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/root/person/avatar.vue b/root/person/avatar.vue
index 86a0fb1..ae0679a 100644
--- a/root/person/avatar.vue
+++ b/root/person/avatar.vue
@@ -23,8 +23,8 @@
-
-
+
+
@@ -49,7 +49,7 @@ export default {
},
data() {
return {
- avatar: uni.getStorageSync("apply-avatar"),
+ avatar: uni.getStorageSync("apply-avatar") || 'https://bocai-cms.oss-cn-beijing.aliyuncs.com/web-resource/1shoudan/defaultAva.svg',
isEdit: false,
size: {
width: uni.getSystemInfoSync().windowWidth,
@@ -90,6 +90,12 @@ export default {
});
that.G.checkToken();
uni.setStorageSync("apply-avatar", res.image);
+ // 同步更新 apply-userinfo 中的头像,确保返回上一页时能显示最新头像
+ let userInfo = uni.getStorageSync("apply-userinfo");
+ if (userInfo && userInfo.user) {
+ userInfo.user.imgSrc = res.image;
+ uni.setStorageSync("apply-userinfo", userInfo);
+ }
setTimeout(() => {
uni.navigateBack();
}, 1500);
@@ -141,6 +147,12 @@ export default {
icon: "success",
});
uni.setStorageSync("apply-avatar", res);
+ // 同步更新 apply-userinfo 中的头像,确保返回上一页时能显示最新头像
+ let userInfo = uni.getStorageSync("apply-userinfo");
+ if (userInfo && userInfo.user) {
+ userInfo.user.imgSrc = res;
+ uni.setStorageSync("apply-userinfo", userInfo);
+ }
setTimeout(() => {
uni.navigateBack();
}, 1500);
diff --git a/root/person/info.vue b/root/person/info.vue
index b3af7be..4feeff9 100644
--- a/root/person/info.vue
+++ b/root/person/info.vue
@@ -107,8 +107,10 @@ export default {
init() {
let that = this;
let userinfo = uni.getStorageSync("apply-userinfo");
+ // 优先读取 apply-avatar,确保获取最新头像
+ let avatar = uni.getStorageSync("apply-avatar");
that.userinfo = {
- imgSrc: userinfo.user.imgSrc || that.svgBaseImg + "defaultAva.svg",
+ imgSrc: avatar || userinfo.user.imgSrc || that.svgBaseImg + "defaultAva.svg",
userName: userinfo.userName,
tel: userinfo.user.tel,
desp: that.userinfo.desp || "请简单介绍",