fix: 修复前端头像显示问题
This commit is contained in:
@@ -100,7 +100,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import "vue-cropper/dist/index.css";
|
import "vue-cropper/dist/index.css";
|
||||||
import { ref, reactive, onMounted } from "vue";
|
import { ref, reactive, onMounted,computed } from "vue";
|
||||||
import { VueCropper } from "vue-cropper";
|
import { VueCropper } from "vue-cropper";
|
||||||
import { upload } from "@/apis/fileApi";
|
import { upload } from "@/apis/fileApi";
|
||||||
import { updateUserIcon } from "@/apis/userApi";
|
import { updateUserIcon } from "@/apis/userApi";
|
||||||
@@ -108,7 +108,6 @@ import { getIconList } from "@/apis/settingApi";
|
|||||||
import useUserStore from "@/stores/user";
|
import useUserStore from "@/stores/user";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
user: {
|
user: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -244,6 +243,12 @@ const confirmImage = async () => {
|
|||||||
isOnlineVisible.value = false;
|
isOnlineVisible.value = false;
|
||||||
};
|
};
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
||||||
|
const userIcon=props.user.icon;
|
||||||
|
options.img=userIcon == "" || userIcon == null
|
||||||
|
? "/acquiesce.png"
|
||||||
|
: import.meta.env.VITE_APP_BASEAPI + "/file/" + userIcon;
|
||||||
|
|
||||||
const { data: iconListData } = await getIconList();
|
const { data: iconListData } = await getIconList();
|
||||||
iconList.value = iconListData.map(
|
iconList.value = iconListData.map(
|
||||||
(item) => import.meta.env.VITE_APP_BASEAPI + "/" + item
|
(item) => import.meta.env.VITE_APP_BASEAPI + "/" + item
|
||||||
|
|||||||
Reference in New Issue
Block a user