feat: 用户头像路径固定

This commit is contained in:
Gsh
2025-08-30 22:39:27 +08:00
parent 93251104af
commit 76aa3bdc64
2 changed files with 2 additions and 5 deletions

View File

@@ -7,7 +7,6 @@ import { useUserStore } from '@/stores';
import { getUserProfilePicture, WECHAT_QRCODE_TYPE } from '@/utils/user.ts';
const userStore = useUserStore();
const user = computed(() => userStore.userInfo.user || {});
const wechatDialogVisible = ref(false);
@@ -167,9 +166,8 @@ function bindWechat() {
</span>
<el-button
v-if="!isWechatBound"
type="text"
size="small"
class="bind-btn"
type="primary"
@click="handleWechatBind"
>
绑定

View File

@@ -12,10 +12,9 @@ export function isUserVip(): boolean {
export function getUserProfilePicture(): string {
const userStore = useUserStore();
return userStore.userInfo?.user?.icon
? `${import.meta.env.VITE_WEB_BASE_API}/file/${userStore.userInfo.user.icon}`
? `https://ccnetcore.com/${import.meta.env.VITE_WEB_BASE_API}/file/${userStore.userInfo.user.icon}`
: `/images/user.png`;
}
// 系统头像(可以常量)
export const systemProfilePicture = `/images/logo.png`;