Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
fix: 修复更新头像后被缓存不更新
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin3go committed Apr 16, 2023
1 parent 6ee3160 commit f262f35
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pages/me/updateUser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ async function save() {
}
// 成功修改后传递给pinia store
meStore.$patch({ user: { ...userData, ...user } });
uni.redirectTo({
url: "/pages/me/index",
uni.navigateBack({
delta: 1,
});
}
Expand All @@ -184,7 +184,7 @@ async function uploadAvatar(filePath: string) {
const { OSSAccessKeyId, policy, signature } = data?.getPostObjectParams || {};
const imgType = filePath.split(".").pop();
const key = `wxmp/${userData?.id}.${imgType}`;
const key = `wxmp/${userData?.id}.${imgType}/${new Date().getTime()}`;
uni.showLoading({ title: "正在上传图片中..." });
const ossRes = await uniUploadFile({
url: ossHost, // 开发者服务器的URL。
Expand Down

0 comments on commit f262f35

Please sign in to comment.